-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
from doctest import ELLIPSIS | ||
from doctest import NORMALIZE_WHITESPACE | ||
|
||
from sybil import Sybil | ||
from sybil.parsers.rest import DocTestParser | ||
|
||
|
||
pytest_collect_file = Sybil( | ||
parsers=[DocTestParser(optionflags=NORMALIZE_WHITESPACE)], | ||
parsers=[DocTestParser(optionflags=NORMALIZE_WHITESPACE + ELLIPSIS)], | ||
patterns=["*.py"], | ||
).pytest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
from doctest import ELLIPSIS | ||
from doctest import NORMALIZE_WHITESPACE | ||
import os | ||
|
||
import pytest | ||
from sybil import Sybil | ||
from sybil.parsers.rest import DocTestParser | ||
from sybil.parsers.rest import PythonCodeBlockParser | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def execute_in_tmpdir(tmpdir_factory): | ||
path = tmpdir_factory.mktemp("doctest") | ||
cwd = os.getcwd() | ||
try: | ||
os.chdir(path) | ||
yield path | ||
finally: | ||
os.chdir(cwd) | ||
|
||
|
||
pytest_collect_file = Sybil( | ||
parsers=[ | ||
DocTestParser(optionflags=NORMALIZE_WHITESPACE), | ||
DocTestParser(optionflags=NORMALIZE_WHITESPACE + ELLIPSIS), | ||
PythonCodeBlockParser(), | ||
], | ||
patterns=["*.rst"], | ||
fixtures=["execute_in_tmpdir"], | ||
).pytest() |