We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85bc5fa commit 2afc3adCopy full SHA for 2afc3ad
html5lib/tests/conftest.py
@@ -1,4 +1,6 @@
1
+from __future__ import print_function
2
import os.path
3
+import sys
4
5
import pkg_resources
6
import pytest
@@ -15,6 +17,26 @@
15
17
_sanitizer_testdata = os.path.join(_dir, "sanitizer-testdata")
16
18
19
20
+def fail_if_missing_pytest_expect():
21
+ """Throws an exception halting pytest if pytest-expect isn't working"""
22
+ try:
23
+ from pytest_expect import expect # noqa
24
+ except ImportError:
25
+ header = '*' * 78
26
+ print(
27
+ '\n' +
28
+ header + '\n' +
29
+ 'ERROR: Either pytest-expect or its dependency u-msgpack-python is not\n' +
30
+ 'installed. Please install them both before running pytest.\n' +
31
+ header + '\n',
32
+ file=sys.stderr
33
+ )
34
+ raise
35
+
36
37
+fail_if_missing_pytest_expect()
38
39
40
def pytest_configure(config):
41
msgs = []
42
0 commit comments