diff --git a/docs/conftest.py b/docs/conftest.py index 8128402b..3f7f7513 100644 --- a/docs/conftest.py +++ b/docs/conftest.py @@ -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 @@ -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', diff --git a/pytest.ini b/pytest.ini index 64d6b548..2b406089 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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 diff --git a/tox.ini b/tox.ini index 25d03fd9..52c08e58 100644 --- a/tox.ini +++ b/tox.ini @@ -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