summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-28 23:02:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-28 23:02:37 (GMT)
commite143c1f94f923db17a0f6d17d05e4af440178c1b (patch)
treebff390016141183abe73eba4e720e3a9514d551c /Lib
parent6b415101a24c26accd409c9e72840953f340a6e7 (diff)
downloadcpython-e143c1f94f923db17a0f6d17d05e4af440178c1b.zip
cpython-e143c1f94f923db17a0f6d17d05e4af440178c1b.tar.gz
cpython-e143c1f94f923db17a0f6d17d05e4af440178c1b.tar.bz2
Fix test_regrtest.test_tools_buildbot_test()
Issue #25220: Fix test_regrtest.test_tools_buildbot_test() on release build (on Windows), pass "+d" option to test.bat.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_regrtest.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index c0f1e7b..ca4b356 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -438,14 +438,7 @@ class ProgramsTestCase(BaseTestCase):
script = os.path.join(ROOT_DIR, 'Tools', 'scripts', 'run_tests.py')
self.run_tests([script, *self.tests])
- def run_rt_bat(self, script, *args):
- rt_args = []
- if platform.architecture()[0] == '64bit':
- rt_args.append('-x64') # 64-bit build
- if Py_DEBUG:
- rt_args.append('-d') # Debug build
-
- args = [script, *rt_args, *args]
+ def run_batch(self, *args):
proc = subprocess.run(args,
check=True, universal_newlines=True,
input='',
@@ -456,15 +449,23 @@ class ProgramsTestCase(BaseTestCase):
def test_tools_buildbot_test(self):
# Tools\buildbot\test.bat
script = os.path.join(ROOT_DIR, 'Tools', 'buildbot', 'test.bat')
- self.run_rt_bat(script, *self.tests)
+ test_args = []
+ if platform.architecture()[0] == '64bit':
+ test_args.append('-x64') # 64-bit build
+ if not Py_DEBUG:
+ test_args.append('+d') # Release build, use python.exe
+ self.run_batch(script, *test_args, *self.tests)
@unittest.skipUnless(sys.platform == 'win32', 'Windows only')
def test_pcbuild_rt(self):
# PCbuild\rt.bat
script = os.path.join(ROOT_DIR, r'PCbuild\rt.bat')
- # -q: quick, don't run tests twice
- rt_args = ["-q"]
- self.run_rt_bat(script, *rt_args, *self.regrtest_args, *self.tests)
+ rt_args = ["-q"] # Quick, don't run tests twice
+ if platform.architecture()[0] == '64bit':
+ rt_args.append('-x64') # 64-bit build
+ if Py_DEBUG:
+ rt_args.append('-d') # Debug build, use python_d.exe
+ self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
class ArgsTestCase(BaseTestCase):