Bug 1466211 - Switch all |mach python-test| tests to run using pipenv; r?ahal
MozReview-Commit-ID: 5BGDjTkEgd7
--- 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