Patchwork [016,of,179,tests-refactor] run-tests: roll pytest() into PythonTest._run()

login
register
mail settings
Submitter Gregory Szorc
Date May 2, 2014, 6:37 p.m.
Message ID <b81c0cdec1404e692bf0.1399055853@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/4511/
State Accepted
Commit f9a7018a35ff9bfef1a78a0735d23d99f1e912af
Headers show

Comments

Gregory Szorc - May 2, 2014, 6:37 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1397944444 25200
#      Sat Apr 19 14:54:04 2014 -0700
# Branch stable
# Node ID b81c0cdec1404e692bf042c67632d65f92fdf9d3
# Parent  9c0fd7bcc4b7a6bc574bde7d8c76131ab669972c
run-tests: roll pytest() into PythonTest._run()

Python was the old runner function. It no longer needs to exist since
the PythonTest class took its job.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -668,29 +668,26 @@  class TestResult(object):
         self.exception = None
         self.refout = None
 
     @property
     def skipped(self):
         """Whether the test was skipped."""
         return self.ret == SKIPPED_STATUS
 
-def pytest(test, wd, options, replacements, env):
-    py3kswitch = options.py3k_warnings and ' -3' or ''
-    cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
-    vlog("# Running", cmd)
-    if os.name == 'nt':
-        replacements.append((r'\r\n', '\n'))
-    return run(cmd, wd, options, replacements, env)
-
 class PythonTest(Test):
     """A Python-based test."""
     def _run(self, testtmp, replacements, env):
-        return pytest(self._path, testtmp, self._options, replacements,
-                      env)
+        py3kswitch = self._options.py3k_warnings and ' -3' or ''
+        cmd = '%s%s "%s"' % (PYTHON, py3kswitch, self._path)
+        vlog("# Running", cmd)
+        if os.name == 'nt':
+            replacements.append((r'\r\n', '\n'))
+        return run(cmd, testtmp, self._options, replacements, env)
+
 
 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
 escapesub = re.compile(r'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub
 escapemap = dict((chr(i), r'\x%02x' % i) for i in range(256))
 escapemap.update({'\\': '\\\\', '\r': r'\r'})
 def escapef(m):
     return escapemap[m.group(0)]
 def stringescape(s):