Bug 1446471 - Remove unused find_tests_by_path function; r?build draft
authorGregory Szorc <gps@mozilla.com>
Tue, 06 Mar 2018 19:02:01 -0800
changeset 768667 db24d7450802a55d7ce84679654a8f3f93d2d674
parent 768523 47e1787284fbfad3d32eb7081ffdda58d2b086de
child 768668 fe66db548c8fe571c7af18c83b3973baf586e6ef
push id102952
push userbmo:gps@mozilla.com
push dateFri, 16 Mar 2018 17:15:15 +0000
reviewersbuild
bugs1446471
milestone61.0a1
Bug 1446471 - Remove unused find_tests_by_path function; r?build I was too lazy to find the commit that orphaned this. But it is most definitely not referenced in the code base. MozReview-Commit-ID: 8gYBJQxIWIR
python/mach_commands.py
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -95,34 +95,16 @@ class MachCommands(MachCommandBase):
                          test_objects=None,
                          subsuite=None,
                          verbose=False,
                          stop=False,
                          jobs=1,
                          **kwargs):
         self._activate_virtualenv()
 
-        def find_tests_by_path():
-            import glob
-            files = []
-            for t in tests:
-                if t.endswith('.py') and os.path.isfile(t):
-                    files.append(t)
-                elif os.path.isdir(t):
-                    for root, _, _ in os.walk(t):
-                        files += glob.glob(mozpath.join(root, 'test*.py'))
-                        files += glob.glob(mozpath.join(root, 'unit*.py'))
-                else:
-                    self.log(logging.WARN, 'python-test',
-                             {'test': t},
-                             'TEST-UNEXPECTED-FAIL | Invalid test: {test}')
-                    if stop:
-                        break
-            return files
-
         # Python's unittest, and in particular discover, has problems with
         # clashing namespaces when importing multiple test modules. What follows
         # is a simple way to keep environments separate, at the price of
         # launching Python multiple times. Most tests are run via mozunit,
         # which produces output in the format Mozilla infrastructure expects.
         # Some tests are run via pytest.
         if test_objects is None:
             from moztest.resolve import TestResolver