@@ -595,18 +595,28 @@ def _lang_enc(filename):
595
595
596
596
class TestReadHtmlEncoding (tm .TestCase ):
597
597
files = glob .glob (os .path .join (DATA_PATH , 'html_encoding' , '*.html' ))
598
+ flavor = 'bs4'
599
+
600
+ @classmethod
601
+ def setUpClass (cls ):
602
+ super (TestReadHtmlEncoding , cls ).setUpClass ()
603
+ _skip_if_none_of ((cls .flavor , 'html5lib' ))
604
+
605
+ def read_html (self , * args , ** kwargs ):
606
+ kwargs ['flavor' ] = self .flavor
607
+ return read_html (* args , ** kwargs )
598
608
599
609
def read_filename (self , f , encoding ):
600
- return read_html (f , encoding = encoding , index_col = 0 )
610
+ return self . read_html (f , encoding = encoding , index_col = 0 )
601
611
602
612
def read_file_like (self , f , encoding ):
603
613
with open (f , 'rb' ) as fobj :
604
- return read_html (BytesIO (fobj .read ()), encoding = encoding ,
605
- index_col = 0 )
614
+ return self . read_html (BytesIO (fobj .read ()), encoding = encoding ,
615
+ index_col = 0 )
606
616
607
617
def read_string (self , f , encoding ):
608
618
with open (f , 'rb' ) as fobj :
609
- return read_html (fobj .read (), encoding = encoding , index_col = 0 )
619
+ return self . read_html (fobj .read (), encoding = encoding , index_col = 0 )
610
620
611
621
def test_encode (self ):
612
622
for f in self .files :
@@ -618,6 +628,15 @@ def test_encode(self):
618
628
tm .assert_frame_equal (from_string , from_filename )
619
629
620
630
631
+ class TestReadHtmlEncodingLxml (TestReadHtmlEncoding ):
632
+ flavor = 'lxml'
633
+
634
+ @classmethod
635
+ def setUpClass (cls ):
636
+ super (TestReadHtmlEncodingLxml , cls ).setUpClass ()
637
+ _skip_if_no (cls .flavor )
638
+
639
+
621
640
class TestReadHtmlLxml (tm .TestCase ):
622
641
@classmethod
623
642
def setUpClass (cls ):
0 commit comments