[Python-Dev] Regression test coupling

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Nov 8 11:02:14 CET 2011


I ran into an error today related to the use of support.TESTFN throughout the 
regression test suite. In my Windows tests, test_base64 passed, but left a file 
(named by support.TESTFN) lying around:

'test_base64' left behind file '@test_3532_tmp'

Much later in the run, a set of unrelated tests started failing, all apparently 
because of the left-behind file - for example, test_mailbox.setUp failed while 
trying to make a directory named by support.TESTFN:

File "c:\Users\Vinay\Projects\pythonv\lib\mailbox.py", line 270, in __init__
  os.mkdir(self._path, 0o700)
PermissionError: [Error 5] Access is denied: 
'c:\\Users\\Vinay\\Projects\\pythonv\\build\\test_python_3532\\@test_3532_tmp'

Sorry if this has come up before, but why do we couple the tests in this way, so 
that failure to clean up in one test causes drive-by failures in other,
unrelated tests?

Regards,

Vinay Sajip



More information about the Python-Dev mailing list