diff options
author | Jim OLeary <jim.oleary@gmail.com> | 2018-12-06 17:21:09 +0000 |
---|---|---|
committer | Jim OLeary <jim.oleary@gmail.com> | 2018-12-06 17:25:09 +0000 |
commit | f411776d5c4793334818877f84ffb8f03879dfdb (patch) | |
tree | f96d7f81d341d40792c34153145d09a54983d4e8 | |
parent | c13eff3dfcbb959eec72cdb153afd6ea2e4e916b (diff) | |
download | mongo-f411776d5c4793334818877f84ffb8f03879dfdb.tar.gz |
SERVER-38110: fixing lint issues
-rwxr-xr-x | buildscripts/generate_resmoke_suites.py | 4 | ||||
-rw-r--r-- | buildscripts/tests/test_generate_resmoke_suites.py | 21 |
2 files changed, 12 insertions, 13 deletions
diff --git a/buildscripts/generate_resmoke_suites.py b/buildscripts/generate_resmoke_suites.py index 14ae68b04a5..c8ca3594b5c 100755 --- a/buildscripts/generate_resmoke_suites.py +++ b/buildscripts/generate_resmoke_suites.py @@ -39,7 +39,6 @@ HEADER_TEMPLATE = """# DO NOT EDIT THIS FILE. All manual edits will be lost. # {suite_file}. """ - MAX_RUNTIME_KEY = "max_runtime" CommitRange = namedtuple("CommitRange", ["start", "end"]) @@ -266,8 +265,7 @@ def get_subsuite_filename(directory, suite_name, index, index_width=None): filled_index = index if index_width is not None: filled_index = str(index).zfill(index_width) - return "{dir}/{suite_name}_{index}.yml".format(dir=directory, - suite_name=suite_name, + return "{dir}/{suite_name}_{index}.yml".format(dir=directory, suite_name=suite_name, index=filled_index) diff --git a/buildscripts/tests/test_generate_resmoke_suites.py b/buildscripts/tests/test_generate_resmoke_suites.py index 76f3bc00de9..f60efee8a6f 100644 --- a/buildscripts/tests/test_generate_resmoke_suites.py +++ b/buildscripts/tests/test_generate_resmoke_suites.py @@ -13,7 +13,6 @@ from buildscripts import generate_resmoke_suites as grs from generate_resmoke_suites import render_suite, render_misc_suite, \ prepare_directory_for_suite - # pylint: disable=missing-docstring,invalid-name,unused-argument,no-self-use @@ -546,9 +545,10 @@ class RenderSuites(unittest.TestCase): def _test(self, size): - suites = [create_suite(start=3*i) for i in range(size)] - expected = [self.EXPECTED_FORMAT .format(*range(3 * i, 3 * (i+1))) - for i in range(len(suites))] + suites = [create_suite(start=3 * i) for i in range(size)] + expected = [ + self.EXPECTED_FORMAT.format(*range(3 * i, 3 * (i + 1))) for i in range(len(suites)) + ] m = mock_open(read_data=yaml.dump({'selector': {'roots': [], 'excludes': ['fixed']}})) with patch('generate_resmoke_suites.open', m, create=True): @@ -558,8 +558,10 @@ class RenderSuites(unittest.TestCase): # The other writes are for the headers. self.assertEquals(len(suites) * 2, handle.write.call_count) handle.write.assert_has_calls([call(e) for e in expected], any_order=True) - calls = [call('buildscripts/resmokeconfig/suites/suite_name.yml', 'r') - for _ in range(len(suites))] + calls = [ + call('buildscripts/resmokeconfig/suites/suite_name.yml', 'r') + for _ in range(len(suites)) + ] m.assert_has_calls(calls, any_order=True) filename = 'tmp/suite_name_{{:0{}}}.yml'.format(int(math.ceil(math.log10(size)))) calls = [call(filename.format(i), 'w') for i in range(size)] @@ -576,7 +578,6 @@ class RenderSuites(unittest.TestCase): class RenderMiscSuites(unittest.TestCase): - def test_single_suite(self): test_list = ['test{}'.format(i) for i in range(10)] @@ -609,7 +610,6 @@ class RenderMiscSuites(unittest.TestCase): class PrepareDirectoryForSuite(unittest.TestCase): - def test_no_directory(self): with patch('generate_resmoke_suites.os') as mock_os,\ patch('generate_resmoke_suites.glob.glob') as mock_glob: @@ -628,8 +628,9 @@ class PrepareDirectoryForSuite(unittest.TestCase): mock_glob.side_effect = (matched, []) prepare_directory_for_suite('suite_name', 'tmp') - mock_glob.assert_has_calls([call('tmp/suite_name_[0-9]*.yml'), - call('tmp/suite_name_misc.yml')]) + mock_glob.assert_has_calls( + [call('tmp/suite_name_[0-9]*.yml'), + call('tmp/suite_name_misc.yml')]) if matched: mock_os.remove.assert_has_calls([call(filename) for filename in matched]) else: |