Consider removing the commented out code block
25 self.commits = [commit]
26
27 self.pull_request.get_commits().reversed = self.commits
28 # self.patch(patch.object(Repository, "get_branch", repository_get_branch)) 29 self.patch(
30 patch.object(Repository, "get_pulls", return_value=[self.pull_request])
31 )
Consider removing the commented out code block
15 def setup_method(self, method):
16 super().setup_method(method)
17
18 # def repository_get_branch(self_, branch_name): 19 # return Mock(name=branch_name, protected=branch_name == self_.default_branch)
20
21 self.pull_request = Mock(
Consider removing the commented out code block
76 def assert_release_manager_calls(self, **_):
77 ...
78 # # Create Pull Request
79 # self.assert_create_pull_request_calls(create_pull_call) 80 #
81 # # Enable Auto Merge
82 # if pull_request:
Consider removing the commented out code block
33 self.auto_update_enabled = self.pull_request_enabled and config.auto_update
34 self.auto_approve_enabled = self.pull_request_enabled and config.auto_approve
35
36 # Config.release_manager.enabled = False 37 # Config.issue_manager.enabled = False
38 # Config.pull_request_manager.set_values(
39 # link_issue=False,
Consider removing the commented out code block
1128#
1129
1130
1131# def test_get_title_and_body_from_issue_without_issue_in_branch(repository_mock):1132# assert get_title_and_body_from_issue(repository_mock, "feature_branch") == ("", "")
1133#
1134#
Consider removing the commented out code block
41 patch.stopall()
42 pull_request_helper.cache.clear()
43
44 # def setUp(self): 45 # default_branch = Mock(name="default_branch", protected=True)
46 # patch.object(Repository, "get_branch", return_value=default_branch).start()
47 #
Consider removing the commented out code block
31 return Mock(name=branch_name)
32
33 patch.object(Repository, "get_branch", repository_get_branch).start()
34 # self.mock_repository_get_content( 35 # "heitorpolidoro/bartholomew-smith", ".bartholomew.yaml", "default_branch", None
36 # )
37 # self.mock_pull_request("heitorpolidoro/bartholomew-smith")
Consider removing the commented out code block
17 ("repository_name", None, "repository_name"), # repository found with name
18 ("repository_name", None, None), # repository not found
19 ],
20 # ids=["oi"]21)
22def test_get_repository(repository_name, repository_owner_login, expected, gh):
23 if expected: # if repository is expected to be found
Consider removing the commented out code block
1# from unittest.mock import Mock, patch, call 2#
3# from github.PullRequest import PullRequest
4# from github.Repository import Repository
Description
It is recommended to remove any commented code in your codebase.
Bad practice
for item in sequence:
# print(item)
do_something(item)
# def old_function():
# '''Older implementation that has been replaced'''
# data = get_data()
# api.post(data)
Recommended
for item in sequence:
do_something(item)