Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Find a way to filter concept exercises by taskno from the command line (concept exercises)

Aperta
#87 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia leggendo l’uso dei marker di pytest e le funzioni conftest menzionate nell’issue, quindi riproduci il problema di selezione delle attività con un esercizio concettuale. Analizza come pytest espone gli argomenti dei marker dalla riga di comando. Il lavoro è completato quando gli utenti possono selezionare i test in base al taskno numerico senza affidarsi a pytest -k e senza selezionare test non correlati.

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

Descrizione

Hi,
Pytest test suites in Exercism contain custom marks in the form of @pytest.mark.task(taskno=X) where X is a whole number. At least in concept exercises, this number corresponds to the task inside the supplied README file.
While doing a concept exercise, I wanted to select pytest tests to run and filter them by this taskno parameter but failed to do so. What I tried:

  1. @BethanyG sent me a link to StackOverflow thread which shows one similar problem:

However, the example code allows to run marks with arguments looking like this:
@pytest.mark.task("taskno1")

Perhaps there is a way to modify something in the conftest functions but I haven't wrapped my head around it.

  1. I tried a plugin called pytest-pilot

It supplies easier syntax for solving similar problems as 1 but also didn't help me solve the problem. I would get an error IndexError: tuple index out of range.

What I use now:

  1. pytest -k keyword_you_need
    It usually works, but sometimes I still select more of fewer tests than needed
  2. pytest --tb=short
    I don't like long error messages from pytests so this is another way to limit pytest from adding too much unwanted output.

Filtering by task number would be "nice to have", but I think solving this problem is interesting in itself. All help is welcome :)

Lingua principale
Python
Stelle
13
Fork
20
Merge medio
20m
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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.

Altre issue di exercism/python-test-runner

Tutte le issue di exercism/python-test-runner

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.