diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..a34a56c --- /dev/null +++ b/conftest.py @@ -0,0 +1,15 @@ +"""Doctest configuration.""" + +from doctest import ELLIPSIS, NORMALIZE_WHITESPACE + +from sybil import Sybil +from sybil.parsers.rest import DocTestParser, PythonCodeBlockParser, SkipParser + +pytest_collect_file = Sybil( + parsers=[ + DocTestParser(optionflags=NORMALIZE_WHITESPACE | ELLIPSIS), + PythonCodeBlockParser(), + SkipParser(), + ], + patterns=["*.rst", "*.py"], +).pytest() diff --git a/pyproject.toml b/pyproject.toml index 3645f4e..8b87807 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ dependencies = [ test = [ "pytest >=6", "pytest-cov >=3", + "sybil", ] dev = [ "pytest >=6",