Find a way to filter concept exercises by taskno from the command line (concept exercises)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
Piste de recherche
Commencez par lire l’utilisation des marqueurs pytest et les fonctions conftest mentionnées dans l’issue, puis reproduisez le problème de sélection des tâches avec un exercice conceptuel. Étudiez comment pytest expose les arguments des marqueurs depuis la ligne de commande. Le travail est terminé lorsque les utilisateurs peuvent sélectionner des tests à l’aide de taskno numérique sans dépendre de pytest -k et sans sélectionner de tests sans rapport.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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:
- @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.
- 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:
pytest -k keyword_you_need
It usually works, but sometimes I still select more of fewer tests than neededpytest --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 :)
- Langage dominant
- Python
- Étoiles
- 13
- Forks
- 20
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de exercism/python-test-runner
-
exercism/python-test-runner#101 · 7 commentaires · 1 personne assignée ·
-
bug
exercism/python-test-runner#67 · 1 personne assignée ·
Toutes les issues de exercism/python-test-runner
Issues similaires
-
documentation help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
simonw/sqlite-utils#872 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100