This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_inspect.py fails to clean up upon failure
Type: Stage:
Components: Build Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: jlgijsbers, ms_
Priority: normal Keywords:

Created on 2004-08-27 12:20 by ms_, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg22239 - (view) Author: Michael (ms_) Date: 2004-08-27 12:20
When test_inspect.py encounters a failure in the code it's testing 
it fails to clean up its temporary files upon exit. This causes 
spurious errors for other tests when debugging. 
 
eg: force a test to fail by changing test_inspect.py such that this: 
test(inspect.getsource(mod2.wrapped) == sourcerange(13, 16), 
"inspect.getsource(mod.wrapped)") 
 
Is replaced with: 
test(inspect.getsource(mod2.wrapped) != sourcerange(13, 16), 
"inspect.getsource(mod.wrapped)") 
 
Clearly this should only cause test_inspect.py to fail, however: 
# ./python Lib/test/regrtest.py test_inspect test_posixpath 
test_inspect 
test test_inspect failed -- inspect.getsource(mod.wrapped) 
test_posixpath 
test test_posixpath failed -- Traceback (most recent call last): 
  File 
"/home/michaels/Python/Cvs/python/dist/src/Lib/test/test_posixpath.py", 
line 148, in test_islink 
    os.symlink(test_support.TESTFN + "1", test_support.TESTFN + 
"2") 
OSError: [Errno 17] File exists 
 
2 tests failed: 
    test_inspect test_posixpath 
 
In this example the reason why test_posixpath failed is due to the 
temporary files left behind by the failed test_inspect. 
msg22240 - (view) Author: Michael (ms_) Date: 2004-08-27 12:27
Logged In: YES 
user_id=994316

Patch against current Anon CVS can be found here: 
* http://www.python.org/sf/1017550 
msg22241 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2005-01-09 01:41
Logged In: YES 
user_id=469548

The new test_inspect no longer writes temporary files, so
I'm closing this bug.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40833
2004-08-27 12:20:57ms_create