Skip to content

Commit 236bbaa

Browse files
committed
fix tests for old python
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 8d3024f commit 236bbaa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_xml.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import logging
2121
import os
2222
from copy import deepcopy
23+
from sys import version_info
24+
from unittest import skipIf
2325

2426
from defusedxml import ElementTree as SafeElementTree
2527

@@ -88,12 +90,13 @@ def test_serializable_no_defaultNS(self) -> None:
8890
data.as_xml(as_string=False, xmlns=xmlns),
8991
method='xml',
9092
encoding='unicode',
91-
default_namespace=None
93+
# default_namespace=None
9294
)
9395
# byte-wise string compare is intentional!
9496
self.maxDiff = None
9597
self.assertEqual(expected, actual)
9698

99+
@skipIf(version_info < (3,8), '`ElementTree.tostring(default_namespace=)` not available')
97100
def test_serializable_with_defaultNS(self) -> None:
98101
"""regression test for https://github.com/madpah/serializable/issues/12"""
99102
from xml.etree import ElementTree

0 commit comments

Comments
 (0)