Skip to content

Commit 3accd12

Browse files
committed
Add test
1 parent 0b85c7d commit 3accd12

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/io/xml/test_xml.py

+13
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,19 @@ def test_read_xml_passing_as_positional_deprecated(datapath):
782782
)
783783

784784

785+
@td.skip_if_no("lxml")
786+
def test_wrong_encoding_for_lxml():
787+
# GH#45133
788+
data = """<data>
789+
<row>
790+
<a>c</a>
791+
</row>
792+
</data>
793+
"""
794+
with pytest.raises(TypeError, match="encoding None"):
795+
read_xml(StringIO(data), parser="lxml", encoding=None)
796+
797+
785798
@td.skip_if_no("lxml")
786799
def test_stylesheet_file_like(datapath, mode):
787800
kml = datapath("io", "data", "xml", "cta_rail_lines.kml")

0 commit comments

Comments
 (0)