1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
from doctest import ELLIPSIS
import pytest
from sybil import Sybil
try: # sybil >= 3
from sybil.parsers.codeblock import PythonCodeBlockParser
except ImportError: # sybil < 3
from sybil.parsers.codeblock import CodeBlockParser as PythonCodeBlockParser
from sybil.parsers.doctest import DocTestParser
from sybil.parsers.skip import skip
pytest_collect_file = Sybil(
parsers=[
DocTestParser(optionflags=ELLIPSIS),
PythonCodeBlockParser(),
skip,
],
pattern='*.rst',
).pytest()
|