File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1037,9 +1037,16 @@ def test_stylesheet_wrong_path():
10371037def test_empty_string_stylesheet (val ):
10381038 from lxml .etree import XMLSyntaxError
10391039
1040- with pytest .raises (
1041- XMLSyntaxError , match = ("Document is empty|Start tag expected, '<' not found" )
1042- ):
1040+ msg = "|" .join (
1041+ [
1042+ "Document is empty" ,
1043+ "Start tag expected, '<' not found" ,
1044+ # Seen on Mac with lxml 4.9.1
1045+ r"None \(line 0\)" ,
1046+ ]
1047+ )
1048+
1049+ with pytest .raises (XMLSyntaxError , match = msg ):
10431050 geom_df .to_xml (stylesheet = val )
10441051
10451052
Original file line number Diff line number Diff line change @@ -471,7 +471,14 @@ def test_file_handle_close(datapath, parser):
471471def test_empty_string_lxml (val ):
472472 from lxml .etree import XMLSyntaxError
473473
474- with pytest .raises (XMLSyntaxError , match = "Document is empty" ):
474+ msg = "|" .join (
475+ [
476+ "Document is empty" ,
477+ # Seen on Mac with lxml 4.91
478+ r"None \(line 0\)" ,
479+ ]
480+ )
481+ with pytest .raises (XMLSyntaxError , match = msg ):
475482 read_xml (val , parser = "lxml" )
476483
477484
You can’t perform that action at this time.
0 commit comments