pytest-dev / pytest-dev/pytest
Deprecate collecting 'test*.txt' files as doctests, replaced by 'test_*.txt'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
I've always thought odd that the pattern for collecting doctest files is test*.txt, while for Python files is test_*.py and *_test.py.
How about we deprecate collecting test*.txt files? Sometimes this tries to collect files which are not test files and can be a source of confusion (https://github.com/pytest-dev/pytest/issues/5445 is the most recent example of this but I'm sure there are more). We could emit a warning when we collect such a file and the user did not specify that option explicitly.
After that we should decide to which pattern we should collect by default then:
test_*.txt.test_*.rst.- Do not collect doctests by default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named; start by tracing pytest's doctest collection behavior and reviewing issue #5445. Decide whether to use test_.txt, test_.rst, or disable default doctest collection, then define the deprecation warning behavior for files collected implicitly versus explicitly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100