#17393 closed Bug (fixed)
Test runner should exclude __pycache__ directories
Reported by: | Ian Clelland | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | Testing Python3 pycache |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Beginning with Python 3.2, the Python runtime now stores .pyc files in a subdirectory named __pycache__
, rather than alongside their counterpart .py sources. These directories are created automatically any time that the code is imported in a Python3.2+ environment.
The test runner needs to explicitly ignore those directories when searching for tests, as it does with hidden files and directories, init.py files, and dirs named 'sql'. Currently, the full (auto-discovered) test suite will not run after tests have been run with Python 3.
This may have implications for other auto discovery mechanisms as well.
Reference: http://www.python.org/dev/peps/pep-3147/
Attachments (1)
Change History (6)
by , 13 years ago
Attachment: | 17393.patch added |
---|
comment:1 by , 13 years ago
Has patch: | set |
---|
comment:2 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
This could be filed against the py3k branch on bitbucket, or we could just apply it after that work has been merged. I don't see a need to apply it before we have any support for Python 3 in trunk.
comment:3 by , 13 years ago
Agreed; I figured it would sit here until 1.4 was released, at least; I just didn't want to have it forgotten. I'll see about pushing this up to bitbucket as well.
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in 865cd35c9b357e20994f6c6a51f2ae000ba0a3ee (was inadvertantly pushed as a more broader cleanup).
Quick patch to exclude bytecode cache dirs