8000 Fix issue #122 by adding instructions on how to get html5lib/tests/te… · blag/html5lib-python@2fe4286 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fe4286

Browse files
author
Drew Hubl
committed
Fix issue html5lib#122 by adding instructions on how to get html5lib/tests/testdata/encoding/chardet/test_big5.txt from git
1 parent f5fd711 commit 2fe4286

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

html5lib/tests/test_encoding.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ def test_encoding():
6262
print("charade/chardet not found, skipping chardet tests")
6363
else:
6464
def test_chardet():
65-
with open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt"), "rb") as fp:
66-
encoding = inputstream.HTMLInputStream(fp.read()).charEncoding
67-
assert encoding[0].lower() == "big5"
65+
try:
66+
with open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt"), "rb") as fp:
67+
encoding = inputstream.HTMLInputStream(fp.read()).charEncoding
68+
assert encoding[0].lower() == "big5"
69+
except IOError as e:
70+
if e.errno == 2: # No such file or directory
71+
print("""
72+
The file
73+
74+
html5lib/tests/testdata/encoding/chardet/test_big5.txt
75+
76+
is missing.
77+
78+
If you cloned it from git, run
79+
80+
git submodule update --init
81+
82+
to clone it and then rerun this test.
83+
""")
84+
raise e

0 commit comments

Comments
 (0)
0