forked from GalacticDynamics/xmmutablemap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
24 lines (17 loc) · 685 Bytes
/
conftest.py
File metadata and controls
24 lines (17 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Doctest configuration."""
from collections.abc import Callable, Iterable, Sequence
from doctest import ELLIPSIS, NORMALIZE_WHITESPACE
from sybil import Document, Region, Sybil
from sybil.parsers import myst, rest
optionflags = ELLIPSIS | NORMALIZE_WHITESPACE
parsers: Sequence[Callable[[Document], Iterable[Region]]] = [
myst.DocTestDirectiveParser(optionflags=optionflags),
myst.PythonCodeBlockParser(doctest_optionflags=optionflags),
myst.SkipParser(),
]
docs = Sybil(parsers=parsers, patterns=["*.md"])
python = Sybil(
parsers=[*parsers, rest.DocTestParser(optionflags=optionflags)],
patterns=["*.py"],
)
pytest_collect_file = (docs + python).pytest()