classification
Title: [EASY] Windows: test_regrtest fails on installed Python
Type: behavior Stage: resolved
Components: Tests, Windows Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, steve.dower, terry.reedy, tim.golden, vstinner, zach.ware
Priority: normal Keywords: easy, patch

Created on 2018-04-25 13:46 by vstinner, last changed 2018-04-30 20:38 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6654 merged adelfino, 2018-04-30 15:21
PR 6656 merged miss-islington, 2018-04-30 16:33
Messages (6)
msg315730 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-25 13:46
Failure on Windows 10 with Python 3.7 beta 3:

======================================================================
ERROR: test_pcbuild_rt (test.test_regrtest.ProgramsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 602, in test_pcbuild_rt
    self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 577, in run_batch
    proc = self.run_command(args)
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 475, in run_command
    **kw)
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 453, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1155, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified


We may just skip the test if the script is not installed.
msg315856 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-04-27 19:12
On my system: py -3.n -m test.test_regrtest (or test test_regrtest) fails for n in {5, 6, 7}.  2.7 runs, but there are far fewer test methods. Repository builds work fine.
msg315942 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-30 08:50
The fix is simple, skip the test if the script doesn't exist at:

    def test_pcbuild_rt(self):
        # PCbuild\rt.bat
        script = os.path.join(ROOT_DIR, r'PCbuild\rt.bat')
msg315952 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-30 16:30
New changeset c3b7a6dfb9c7e69093c9fe78ab587e14743e5152 by Victor Stinner (Andrés Delfino) in branch 'master':
bpo-33352: Skip test_regrtest test if rt.bat does not exist (GH-6654)
https://github.com/python/cpython/commit/c3b7a6dfb9c7e69093c9fe78ab587e14743e5152
msg315962 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-30 20:36
New changeset 8075868f19967f291f123f17962a453b38dec8d2 by Victor Stinner (Miss Islington (bot)) in branch '3.7':
bpo-33352: Skip test_regrtest test if rt.bat does not exist (GH-6654) (#6656)
https://github.com/python/cpython/commit/8075868f19967f291f123f17962a453b38dec8d2
msg315963 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-30 20:38
I'm not sure that Python 3.6. In case of doubt, I prefer to skip it.

The bug has been fixed in Python 3.7 and master. Thanks Andrés Delfino for your nice contribution!
History
Date User Action Args
2018-04-30 20:38:59vstinnersetresolution: fixed
2018-04-30 20:38:53vstinnersetstatus: open -> closed

messages: + msg315963
stage: patch review -> resolved
2018-04-30 20:36:59vstinnersetmessages: + msg315962
2018-04-30 16:33:00miss-islingtonsetpull_requests: + pull_request6352
2018-04-30 16:30:56vstinnersetmessages: + msg315952
2018-04-30 15:21:47adelfinosetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request6350
2018-04-30 08:50:40vstinnersetkeywords: + easy

messages: + msg315942
title: Windows: test_regrtest fails on installed Python -> [EASY] Windows: test_regrtest fails on installed Python
2018-04-27 19:12:55terry.reedysetversions: + Python 3.6
nosy: + terry.reedy

messages: + msg315856

type: behavior
stage: needs patch
2018-04-25 13:46:37vstinnercreate