Skip to content

Commit ce8ef5b

Browse files
authored
Merge pull request #166 from scipy/register_assert_rewrite
BUG: pytest register_assert_rewrites of internal modules
2 parents efa2d59 + 77a045e commit ce8ef5b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scipy_doctest/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55

66
__version__ = "1.3dev0"
77

8+
try:
9+
# register internal modules with pytest; obscure errors galore otherwise
10+
import pytest
11+
pytest.register_assert_rewrite(
12+
"scipy_doctest.conftest", "scipy_doctest.impl", "scipy_doctest.util",
13+
"scipy_doctest.frontend", "scipy_doctest.plugin"
14+
)
15+
except ModuleNotFoundError:
16+
# pytest is optional, so nothing to do
17+
pass
18+
19+
820
from .impl import DTChecker, DTFinder, DTParser, DTRunner, DebugDTRunner, DTConfig # noqa
921
from .frontend import testmod, testfile, find_doctests, run_docstring_examples # noqa
1022

0 commit comments

Comments
 (0)