Skip to content

Commit

Permalink
Add a fix for new Sybil (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Dec 22, 2021
1 parent 13abef2 commit f5f73d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from doctest import ELLIPSIS, NORMALIZE_WHITESPACE

from sybil import Sybil
from sybil.parsers.codeblock import CodeBlockParser
try:
from sybil.parsers.codeblock import PythonCodeBlockParser
except ImportError:
from sybil.parsers.codeblock import CodeBlockParser as PythonCodeBlockParser
from sybil.parsers.doctest import DocTestParser
from sybil.parsers.skip import skip

Expand All @@ -22,7 +25,7 @@ def setup(namespace):
pytest_collect_file = Sybil(
parsers=[
DocTestParser(optionflags=ELLIPSIS | NORMALIZE_WHITESPACE),
CodeBlockParser(future_imports=['print_function']),
PythonCodeBlockParser(future_imports=['print_function']),
skip,
],
pattern='*.rst',
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
addopts = --assert=plain --doctest-modules --ignore=setup.py
flake8-ignore =
E203
docs/conftest.py E501
parsel/csstranslator.py E501
parsel/selector.py E501
parsel/utils.py E226 E501
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ commands =
[testenv:flake8]
deps =
{[testenv]deps}
flake8<4 # https://github.com/tholo/pytest-flake8/issues/81
pytest-flake8
commands =
pytest --flake8
Expand Down

0 comments on commit f5f73d3

Please sign in to comment.