diff --git a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py index ce93eff6..dad167c5 100644 --- a/html5lib/tests/conftest.py +++ b/html5lib/tests/conftest.py @@ -1,4 +1,6 @@ +from __future__ import print_function import os.path +import sys import pkg_resources import pytest @@ -15,6 +17,26 @@ _sanitizer_testdata = os.path.join(_dir, "sanitizer-testdata") +def fail_if_missing_pytest_expect(): + """Throws an exception halting pytest if pytest-expect isn't working""" + try: + from pytest_expect import expect # noqa + except ImportError: + header = '*' * 78 + print( + '\n' + + header + '\n' + + 'ERROR: Either pytest-expect or its dependency u-msgpack-python is not\n' + + 'installed. Please install them both before running pytest.\n' + + header + '\n', + file=sys.stderr + ) + raise + + +fail_if_missing_pytest_expect() + + def pytest_configure(config): msgs = [] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy