pytest-dev / pytest-dev/pytest

Allow disabling of additive options

Open
#2,036 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: config type: enhancement type: proposal
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

Best I can tell, there's no way to suppress the running of doctests. If --doctest-modules is indicated in the pytest.ini (or similar), the only way to disable those tests for a particular run is to edit the file to remove that option (and then of course remember later to undo that change before making other commits to the code).

Better would be for all opt-in options such as --doctest-modules to have an equivalent opt-out option to override the setting from a broader scope, allowing a command-line invocation to supersede the standard test process.

I could imagine a few ways this could be accomplished, but unless prompted, I'll defer to the sensibilities of the maintainers as to how this should be accomplished in pytest.

Contributor guide

Open the contributing guide

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.

Research direction

Begin by reviewing how --doctest-modules from pytest.ini is parsed and applied during a command-line run. No source files or tests are named, so clarify the override semantics with maintainers first; done should mean a command-line option can suppress configured doctests without editing pytest.ini, with coverage for that behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.