We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 464c4ce commit ec4bd0bCopy full SHA for ec4bd0b
pandas/tests/io/test_html.py
@@ -967,3 +967,26 @@ def test_importcheck_thread_safety():
967
while helper_thread1.is_alive() or helper_thread2.is_alive():
968
pass
969
assert None is helper_thread1.err is helper_thread2.err
970
+
971
972
+def test_parse_failure_unseekable():
973
+ _skip_if_no('lxml')
974
975
+ class UnseekableStringIO(StringIO):
976
+ def seekable(self):
977
+ return False
978
979
+ good = UnseekableStringIO('''
980
+ <table><tr><td>spam<br />eggs</td></tr></table>''')
981
+ bad = UnseekableStringIO('''
982
+ <table><tr><td>spam<foobr />eggs</td></tr></table>''')
983
984
+ assert read_html(good)
985
+ assert read_html(bad, flavor='bs4')
986
987
+ bad.seek(0)
988
989
+ with pytest.raises(ValueError,
990
+ match='passed a non-rewindable file object'):
991
+ read_html(bad)
992
0 commit comments