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 dac5f83 commit 440d1e5Copy full SHA for 440d1e5
tests/test_extruct.py
@@ -49,3 +49,19 @@ def _microdata_custom_url(self, test_file):
49
get_testdata('schema.org', test_file)
50
.decode('UTF-8'))}
51
return body, expected
52
+
53
+ def test_errors(self):
54
+ body = ''
55
56
+ # raise exceptions
57
+ with pytest.raises(Exception):
58
+ data = extruct.extract(body)
59
60
+ # ignore exceptions
61
+ expected = {}
62
+ data = extruct.extract(body, errors='ignore')
63
+ assert data == expected
64
65
66
+ data = extruct.extract(body, errors='log')
67
0 commit comments