# HG changeset patch # User Dave Hunt # Date 1528651846 -3600 # Sun Jun 10 18:30:46 2018 +0100 # Node ID 7a6d20e982832372a931da68f9b16063901735e2 # Parent 01f0eb4d4667dd0c26d7d8ec39c714c1f5918492 Bug 1465887 - Allow test manifests to skip based on Python version; r=ahal This patch allows us to enable Python 3 tests and skip any tests that fail so that we can work on adding support for Python 3 without risking regressing any existing support. It will also eventually allow us to skip tests from running against Python 2, when we decide to drop support for it. To skip a test against Python 3, add "skip-if = python == 3" to the [DEFAULT] or test file section of a manifest file. MozReview-Commit-ID: KYzjW6PQw2Q diff --git a/python/mach_commands.py b/python/mach_commands.py --- a/python/mach_commands.py +++ b/python/mach_commands.py @@ -120,17 +120,18 @@ class MachCommands(MachCommandBase): mp.tests.extend(test_objects) filters = [] if subsuite == 'default': filters.append(mpf.subsuite(None)) elif subsuite: filters.append(mpf.subsuite(subsuite)) - tests = mp.active_tests(filters=filters, disabled=False, **mozinfo.info) + python = 3 if three else 2 + tests = mp.active_tests(filters=filters, disabled=False, python=python, **mozinfo.info) if not tests: submsg = "for subsuite '{}' ".format(subsuite) if subsuite else "" message = "TEST-UNEXPECTED-FAIL | No tests collected " + \ "{}(Not in PYTHON_UNITTEST_MANIFESTS?)".format(submsg) self.log(logging.WARN, 'python-test', {}, message) return 1