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