Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2afc3ad

Browse files
willkggsnedders
authored andcommitted
Fail hard with tracebacks if pytest-expect isn't working (#360)
Fixes#329
1 parent85bc5fa commit2afc3ad

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎html5lib/tests/conftest.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
from __future__importprint_function
12
importos.path
3+
importsys
24

35
importpkg_resources
46
importpytest
@@ -15,6 +17,26 @@
1517
_sanitizer_testdata=os.path.join(_dir,"sanitizer-testdata")
1618

1719

20+
deffail_if_missing_pytest_expect():
21+
"""Throws an exception halting pytest if pytest-expect isn't working"""
22+
try:
23+
frompytest_expectimportexpect# noqa
24+
exceptImportError:
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+
1840
defpytest_configure(config):
1941
msgs= []
2042

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp