Skip to content

Commit 20e7ef2

Browse files
committed
Updating implementation per reviewer recommendations.
1 parent 00f7b15 commit 20e7ef2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/io/xml/test_xml.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,13 +1370,14 @@ def test_stylesheet_with_etree(kml_cta_rail_lines, xsl_flatten_doc):
13701370
@td.skip_if_no("lxml")
13711371
@pytest.mark.parametrize("val", ["", b""])
13721372
def test_empty_stylesheet(val):
1373-
from lxml.etree import XMLSyntaxError
1374-
1373+
msg = (
1374+
"Passing literal xml to 'read_xml' is deprecated and "
1375+
"will be removed in a future version. To read from a "
1376+
"literal string, wrap it in a 'StringIO' object."
1377+
)
13751378
kml = os.path.join("data", "xml", "cta_rail_lines.kml")
13761379

1377-
with pytest.raises(
1378-
XMLSyntaxError, match=("Document is empty|Start tag expected, '<' not found")
1379-
):
1380+
with pytest.raises(FutureWarning, match=msg):
13801381
read_xml(kml, stylesheet=val)
13811382

13821383

0 commit comments

Comments
 (0)