Don't run importlib tests for the "source" version

Offen
#92,328 3 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
35/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
testing-qa

Rechercherichtung

Beginne mit dem importlib-Test-Setup in Lib/test/test_importlib/test_api.py um die Zeilen 97–99, überprüfe anschließend die Quell- und Frozen-Testpfade sowie das in #92265 beschriebene Problem. Ermittle, welche Abdeckung die Tests der Quellversion bieten; abgeschlossen ist die Aufgabe, wenn die Begründung dokumentiert und die Änderung an der Testsuite nur vorgenommen wird, falls diese Abdeckung unnötig ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

tests topic-importlib type-feature

Feature or enhancement

Simplify the test suite by not running the importlib tests on the source version, only the frozen one.

Pitch

Currently, we are running the tests against both the source and frozen versions of importlib.

Example:
https://github.com/python/cpython/blob/main/Lib/test/test_importlib/test_api.py#L97-L99

In #92265, we ran into a non-trivial issue where the frozen finders were leaking into source version of the tests, and I suspect some other tests might have the same issue. Me and @ericsnowcurrently spent quite a bit of time tracking it down, though I acknowledge it could have been easier for someone like Brett, who is more versed in this part of the code.

AFAICT, the only version of the modules users will actually use is the frozen one, making me question if the increased complexity in the test suite is worth it. I am under the impression that this was not always the case, which would explain a bit better why we are testing both versions.

So, would it be reasonable to simply remove the source version of the tests? What value is it actually providing? Did I overlook something here?

cc @brettcannon @ericsnowcurrently @warsaw

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.