diff options
Diffstat (limited to 'buildscripts/tests/resmokelib/test_selector.py')
-rw-r--r-- | buildscripts/tests/resmokelib/test_selector.py | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py index 639d6f74ea6..a37147726ab 100644 --- a/buildscripts/tests/resmokelib/test_selector.py +++ b/buildscripts/tests/resmokelib/test_selector.py @@ -1,7 +1,5 @@ """Unit tests for the buildscripts.resmokelib.selector module.""" -from __future__ import absolute_import - import fnmatch import os.path import unittest @@ -194,7 +192,7 @@ class TestTestList(unittest.TestCase): def test_roots_unknown_file(self): roots = ["dir/subdir1/unknown"] - with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"): + with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"): selector._TestList(self.test_file_explorer, roots, tests_are_files=True) def test_include_files(self): @@ -225,7 +223,7 @@ class TestTestList(unittest.TestCase): def test_exclude_files_no_match(self): roots = ["dir/subdir1/*.js", "dir/subdir2/test21.*"] test_list = selector._TestList(self.test_file_explorer, roots) - with self.assertRaisesRegexp(ValueError, "Unrecognized test file: .*$"): + with self.assertRaisesRegex(ValueError, "Unrecognized test file: .*$"): test_list.exclude_files(["dir/subdir2/test26.js"]) def test_exclude_files_glob(self): @@ -354,8 +352,8 @@ class TestSelector(unittest.TestCase): def test_select_exclude_files(self): config = selector._SelectorConfig( - roots=["dir/subdir1/*.js", "dir/subdir2/*.js", - "dir/subdir3/a/*.js"], exclude_files=["dir/subdir2/test21.js"]) + roots=["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"], + exclude_files=["dir/subdir2/test21.js"]) selected, excluded = self.selector.select(config) self.assertEqual( ["dir/subdir1/test11.js", "dir/subdir1/test12.js", "dir/subdir3/a/test3a1.js"], @@ -364,8 +362,8 @@ class TestSelector(unittest.TestCase): def test_select_include_files(self): config = selector._SelectorConfig( - roots=["dir/subdir1/*.js", "dir/subdir2/*.js", - "dir/subdir3/a/*.js"], include_files=["dir/subdir2/test21.js"]) + roots=["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"], + include_files=["dir/subdir2/test21.js"]) selected, excluded = self.selector.select(config) self.assertEqual(["dir/subdir2/test21.js"], selected) self.assertEqual( @@ -374,8 +372,8 @@ class TestSelector(unittest.TestCase): def test_select_include_tags(self): config = selector._SelectorConfig( - roots=["dir/subdir1/*.js", "dir/subdir2/*.js", - "dir/subdir3/a/*.js"], include_tags="tag1") + roots=["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"], + include_tags="tag1") selected, excluded = self.selector.select(config) self.assertEqual([], selected) self.assertEqual([ @@ -385,8 +383,8 @@ class TestSelector(unittest.TestCase): def test_select_include_any_tags(self): config = selector._SelectorConfig( - roots=["dir/subdir1/*.js", "dir/subdir2/*.js", - "dir/subdir3/a/*.js"], include_with_any_tags=["tag1"]) + roots=["dir/subdir1/*.js", "dir/subdir2/*.js", "dir/subdir3/a/*.js"], + include_with_any_tags=["tag1"]) selected, excluded = self.selector.select(config) self.assertEqual([], selected) self.assertEqual([ @@ -412,8 +410,8 @@ class TestMultiJSSelector(unittest.TestCase): total += 3 self.assertLessEqual( - len(selected[-1]), 3, "Last selected group did not have 3 or fewer tests: {}".format( - selected[-1])) + len(selected[-1]), 3, + "Last selected group did not have 3 or fewer tests: {}".format(selected[-1])) total += len(selected[-1]) self.assertEqual(total, MockTestFileExplorer.NUM_JS_FILES * config.group_count_multiplier, @@ -557,7 +555,7 @@ class TestFilterTests(unittest.TestCase): def test_jstest_unknown_file(self): config = {"roots": ["dir/subdir1/*.js", "dir/subdir1/unknown"]} - with self.assertRaisesRegexp(ValueError, "Unrecognized test file: dir/subdir1/unknown"): + with self.assertRaisesRegex(ValueError, "Unrecognized test file: dir/subdir1/unknown"): selector.filter_tests("js_test", config, self.test_file_explorer) def test_json_schema_exclude_files(self): |