Bug 1466211 - Switch all |mach python-test| tests to run using pipenv; r?ahal draft
authorDave Hunt <dhunt@mozilla.com>
Fri, 01 Jun 2018 15:44:46 +0100
changeset 803744 dd71cbb96f27586fea7a9230839226b8bc50ab75
parent 803743 d8f180ab74921fd07a66d6868914a48e5f9ea797
child 803745 4d50cf199f00abe1e60f635b46ac42e381701bf9
push id112168
push userbmo:dave.hunt@gmail.com
push dateMon, 04 Jun 2018 19:30:22 +0000
reviewersahal
bugs1466211
milestone62.0a1
Bug 1466211 - Switch all |mach python-test| tests to run using pipenv; r?ahal MozReview-Commit-ID: 5BGDjTkEgd7
config/mozunit/mozunit/mozunit.py
python/mach_commands.py
--- a/config/mozunit/mozunit/mozunit.py
+++ b/config/mozunit/mozunit/mozunit.py
@@ -228,13 +228,12 @@ def main(*args, **kwargs):
     else:
         args = list(args)
         if os.environ.get('MACH_STDOUT_ISATTY') and not any(a.startswith('--color') for a in args):
             args.append('--color=yes')
 
         module = __import__('__main__')
         args.extend([
             '-vv',
-            '-p', 'mozlog.pytest_mozlog.plugin',
             '-p', 'no:cacheprovider',
             module.__file__,
         ])
         sys.exit(pytest.main(args))
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -94,21 +94,18 @@ class MachCommands(MachCommandBase):
     def run_python_tests(self,
                          tests=None,
                          test_objects=None,
                          subsuite=None,
                          verbose=False,
                          jobs=1,
                          three=False,
                          **kwargs):
-        if three:
-            # use pipenv to run tests against Python 3
-            self.activate_pipenv(os.path.join(here, 'Pipfile'), ['--three'])
-        else:
-            self._activate_virtualenv()
+        pipenv_args = ['--three' if three else '--two']
+        self.activate_pipenv(os.path.join(here, 'Pipfile'), pipenv_args)
 
         if test_objects is None:
             from moztest.resolve import TestResolver
             resolver = self._spawn(TestResolver)
             # If we were given test paths, try to find tests matching them.
             test_objects = resolver.resolve_tests(paths=tests, flavor='python')
         else:
             # We've received test_objects from |mach test|. We need to ignore