unittest discovery and test.regrtest cannot find tests when they're not on the filesystem

Offen
#157,144 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
testing-qa

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.

Beschreibung

stdlib tests type-feature

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
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
36k
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
558

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python/cpython

Alle Issues in python/cpython

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.