Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli, testing

Research direction

Start by reading the pytest mark usage and the conftest functions mentioned in the issue, then reproduce the task selection problem with a concept exercise. Investigate how pytest exposes marker arguments from the command line. Done means users can select tests by the numeric taskno without relying on pytest -k and without selecting unrelated tests.

Written by the indexing model from the issue text.

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:

  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 :)

Dominant language
Python
Stars
13
Forks
20
Avg merge
20m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/python-test-runner

All issues in exercism/python-test-runner

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.