@@ -867,8 +867,7 @@ def test_xml_declaration_pretty_print():
867
867
assert output == expected
868
868
869
869
870
- @td .skip_if_no ("lxml" )
871
- def test_no_pretty_print_with_decl ():
870
+ def test_no_pretty_print_with_decl (parser ):
872
871
expected = (
873
872
"<?xml version='1.0' encoding='utf-8'?>\n "
874
873
"<data><row><index>0</index><shape>square</shape>"
@@ -879,7 +878,7 @@ def test_no_pretty_print_with_decl():
879
878
"</row></data>"
880
879
)
881
880
882
- output = geom_df .to_xml (pretty_print = False , parser = "lxml" )
881
+ output = geom_df .to_xml (pretty_print = False , parser = parser )
883
882
output = equalize_decl (output )
884
883
885
884
# etree adds space for closed tags
@@ -889,8 +888,7 @@ def test_no_pretty_print_with_decl():
889
888
assert output == expected
890
889
891
890
892
- @td .skip_if_no ("lxml" )
893
- def test_no_pretty_print_no_decl ():
891
+ def test_no_pretty_print_no_decl (parser ):
894
892
expected = (
895
893
"<data><row><index>0</index><shape>square</shape>"
896
894
"<degrees>360</degrees><sides>4.0</sides></row><row>"
@@ -900,7 +898,11 @@ def test_no_pretty_print_no_decl():
900
898
"</row></data>"
901
899
)
902
900
903
- output = geom_df .to_xml (xml_declaration = False , pretty_print = False )
901
+ output = geom_df .to_xml (xml_declaration = False , pretty_print = False , parser = parser )
902
+
903
+ # etree adds space for closed tags
904
+ if output is not None :
905
+ output = output .replace (" />" , "/>" )
904
906
905
907
assert output == expected
906
908
0 commit comments