# HG changeset patch # User Gregory Szorc # Date 2014-04-25 22:11:38 # Node ID aecac8059c00a34c53d3decd9b824941640785fc # Parent 9d2ba7e2324dc4d9f33af1f07e3b748470690f67 run-tests: make testdir an argument of TestSuite.__init__ With this change, TestSuite no longer accesses anything on TestRunner and the TestRunner is no longer passed to TestSuite. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1153,11 +1153,15 @@ class TestResult(unittest._TextTestResul class TestSuite(unittest.TestSuite): """Custom unitest TestSuite that knows how to execute Mercurial tests.""" - def __init__(self, runner, jobs=1, whitelist=None, blacklist=None, + def __init__(self, testdir, jobs=1, whitelist=None, blacklist=None, retest=False, keywords=None, loop=False, *args, **kwargs): """Create a new instance that can run tests with a configuration. + testdir specifies the directory where tests are executed from. This + is typically the ``tests`` directory from Mercurial's source + repository. + jobs specifies the number of jobs to run concurrently. Each test executes on its own thread. Tests actually spawn new processes, so state mutation should not be an issue. @@ -1179,7 +1183,6 @@ class TestSuite(unittest.TestSuite): """ super(TestSuite, self).__init__(*args, **kwargs) - self._runner = runner self._jobs = jobs self._whitelist = whitelist self._blacklist = blacklist @@ -1509,7 +1512,8 @@ class TestRunner(object): failed = False warned = False - suite = TestSuite(self, jobs=self.options.jobs, + suite = TestSuite(self.testdir, + jobs=self.options.jobs, whitelist=self.options.whitelisted, blacklist=self.options.blacklist, retest=self.options.retest,