python / python/mypy

Trim "mypy/tests/testX.py::XDataSuite::" from test items

Aperta
#15,260 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature topic-developer topic-tests
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

We can rewrite test collection so that e.g. test-data/unit/check-abstract.test is deemed the test node, rather than mypy/test/testcheck.py::CheckTestSuite::check-abstract.test. This would improve the ergonomics of test invocation, so that one could simply invoke e.g.

pytest test-data/unit/check-abstract.test

Technically, we'd follow the recipe in Working with non-python tests. Each data suite would implement a pytest_collect_file. However, it would also mean we'd need a "registry" of all data suites, since the collection mechanism would need to "ask" all data suites whether they handle the file (in some cases, multiple data suites could each emit items for the same file & test -- see test_name_suffix).

The non-data-suite tests (e.g. those deriving from TestCase) would remain unaffected.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal percorso di collection per mypy/test/testcheck.py::CheckTestSuite::check-abstract.test e dal file di dati test-data/unit/check-abstract.test. Leggi la recipe Working with non-python tests di pytest, quindi segui come data suites e test_name_suffix identificano attualmente gli elementi. Il lavoro è concluso quando pytest può invocare direttamente il file di dati, mentre i test TestCase che non fanno parte di data suites rimangono invariati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
testing-qa
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.