##// END OF EJS Templates
run-tests: move py3kwarnings to Test.__init__
Gregory Szorc -
r21516:1e275c09 default
parent child Browse files
Show More
@@ -341,7 +341,8 b' class Test(unittest.TestCase):'
341 341 def __init__(self, options, path, tmpdir, abort, keeptmpdir=False,
342 342 debug=False, nodiff=False, diffviewer=None,
343 343 interactive=False, timeout=defaults['timeout'],
344 startport=defaults['port'], extraconfigopts=None):
344 startport=defaults['port'], extraconfigopts=None,
345 py3kwarnings=False):
345 346 """Create a test from parameters.
346 347
347 348 options are parsed command line options that control test execution.
@@ -377,6 +378,8 b' class Test(unittest.TestCase):'
377 378 extraconfigopts is an iterable of extra hgrc config options. Values
378 379 must have the form "key=value" (something understood by hgrc). Values
379 380 of the form "foo.key=value" will result in "[foo] key=value".
381
382 py3kwarnings enables Py3k warnings.
380 383 """
381 384
382 385 self.path = path
@@ -395,6 +398,7 b' class Test(unittest.TestCase):'
395 398 self._timeout = timeout
396 399 self._startport = startport
397 400 self._extraconfigopts = extraconfigopts or []
401 self._py3kwarnings = py3kwarnings
398 402 self._daemonpids = []
399 403
400 404 self._finished = None
@@ -689,7 +693,7 b' class PythonTest(Test):'
689 693 return os.path.join(self._testdir, '%s.out' % self.name)
690 694
691 695 def _run(self, replacements, env):
692 py3kswitch = self._options.py3k_warnings and ' -3' or ''
696 py3kswitch = self._py3kwarnings and ' -3' or ''
693 697 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, self.path)
694 698 vlog("# Running", cmd)
695 699 if os.name == 'nt':
@@ -1522,7 +1526,8 b' class TestRunner(object):'
1522 1526 interactive=self.options.interactive,
1523 1527 timeout=self.options.timeout,
1524 1528 startport=self.options.port + count * 3,
1525 extraconfigopts=self.options.extra_config_opt)
1529 extraconfigopts=self.options.extra_config_opt,
1530 py3kwarnings=self.options.py3k_warnings)
1526 1531
1527 1532 def _cleanup(self):
1528 1533 """Clean up state from this test invocation."""
General Comments 0
You need to be logged in to leave comments. Login now