#3554 defect new
Tests should not fail when .pycs are out of date or invalid
|Reported by:||radix||Owned by:|
We have a number of tests which fail if .pycs are either out of date or point to non-existent .py files. One might say that this is a bug in Python, but it's a bug that the Python developers are certainly not going to fix, so it's something we have to deal with.
Making trial delete .pycs might be an option, and would probably solve the majority of cases where these tests fail. It would still fail if you have broken .pyc files in a non-writable directory, but that probably happens only very rarely.
Another option would be to change all of the tests so that they avoid the problem: some of them are asserting things about the formatted traceback, which could be avoided perhaps by invalidating a linecache or only asserting those things about freshly-generated .py files?
The warning testing infrastructure seems very sensitive to this issue, probably because it's checking filenames from something that honors the paths found in .pyc files, but I'm not sure.