unittest discovery and test.regrtest cannot find tests when they're not on the filesystem
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug report
Bug description:
When the standard library is a zip archive on sys.path, the test package is not a directory: findtests() failed with an OSError from os.listdir() and load_package_tests() failed with "Start directory is not importable" from unittest discovery.
I'm still deciding if this should be done, it is perhaps odd thing to do to bundle tests into an archive before running, but this should apply to other import hooks as well and bundling tests into a zip is sort of a nice way of running tests against a fully zipped application. It's a feature regardless.
Linked PRs
- gh-157145
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Untersuchung von unittest discovery und test.regrtest und reproduziere dann den Fehler mit der Standardbibliothek in einem Zip-Archiv auf sys.path. Als erledigt gilt, wenn test discovery und regrtest Tests über Import-Hooks außerhalb des Dateisystems finden und ausführen können; gh-157145 ist der verknüpfte PR, der zuerst geprüft werden soll.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- testing-qa
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100