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

Appearance settings

Commit 2b73979

Browse filesBrowse files
committed
Fix #122: Check the testdata submodule is present
1 parent 8852ff4 commit 2b73979
Copy full SHA for 2b73979

File tree

1 file changed

+15
-3
lines changed
Filter options

1 file changed

+15
-3
lines changed

‎html5lib/tests/conftest.py

Copy file name to clipboardExpand all lines: html5lib/tests/conftest.py
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import os.path
22

3+
import pytest
4+
35
from .tree_construction import TreeConstructionFile
46
from .tokenizer import TokenizerFile
57
from .sanitizer import SanitizerFile
@@ -11,9 +13,19 @@
1113
_sanitizer_testdata = os.path.join(_dir, "sanitizer-testdata")
1214

1315

14-
def pytest_collectstart():
15-
"""check to see if the git submodule has been init'd"""
16-
pass
16+
def pytest_configure(config):
17+
msgs = []
18+
if not os.path.exists(_testdata):
19+
msg = "testdata not available! "
20+
if os.path.exists(os.path.join(_dir, "..", "..", ".git")):
21+
msg += ("Please run git submodule update --init --recursive " +
22+
"and then run tests again.")
23+
else:
24+
msg += ("The testdata doesn't appear to be included with this package, " +
25+
"so finding the right version will be hard. :(")
26+
msgs.append(msg)
27+
if msgs:
28+
pytest.exit("\n".join(msgs))
1729

1830

1931
def pytest_collect_file(path, parent):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.