-
-
Notifications
You must be signed in to change notification settings - Fork 661
Description
This ticket improves a few things about how doctest treats pytest.
-
Introduce the option to specify in function doc
TESTS: pytest
. This marks the function as tested for thesage-coverage
command. Sometimes (but rarely) you have private or protected methods that don't need a proper "EXAMPLES" doctest. In these cases, one can decide to either write traditionalTESTS
or use pytest to test the method. In the later case,sage-coverage
would mark the function as not tested as it's not aware of pytest; so we have to specify explicitly that we use pytest to cover this method. One could even argue that private/protected methods shouldn't be directly tested at all as they are implementation details; but let's not open this discussion. -
Remove
_test.py
files from doctest coverage. By our convention, these are pytest files and thus almost never have (extensive) doctests. -
To make this work, existing
xyz_test.py
files that are not using pytest are renamed totest_xyz.py
.
CC: @mkoeppe @fchapoton @egourgoulhon @tornaria
Component: doctest coverage
Author: Tobias Diez
Branch/Commit: 01f376c
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/32975