Mercurial > p > roundup > code
diff test/test_xmlrpc.py @ 8238:05405220dc38
issue2551116 - difusedxml support - python2 fixups.
Make sure python2 code path sets client.defusedxml so the code can
still run.
Bomb tests fail under python2. So disable test under python 2. In the
past it was due to string/byte type difference. Not worth fixing the
tests since python 2 support dropped.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 29 Dec 2024 19:48:42 -0500 |
| parents | 57325fea9982 |
| children | 31f86326bee8 |
line wrap: on
line diff
--- a/test/test_xmlrpc.py Sun Dec 29 19:11:01 2024 -0500 +++ b/test/test_xmlrpc.py Sun Dec 29 19:48:42 2024 -0500 @@ -35,6 +35,13 @@ skip_defusedxml_used = lambda func, *args, **kwargs: func +if sys.version_info[0] > 2: + skip_python2 = lambda func, *args, **kwargs: func +else: + skip_python2 = mark_class(pytest.mark.skip( + reason='Skipping test under python 2')) + + class XmlrpcTest(object): backend = None @@ -327,10 +334,12 @@ for n, r in enumerate(result): self.assertEqual(r, results[n]) + @skip_python2 @skip_defusedxml def testDefusedXmlBomb(self): self.XmlBomb(expectIn=b"defusedxml.common.EntitiesForbidden") + @skip_python2 @skip_defusedxml_used def testNonDefusedXmlBomb(self): self.XmlBomb(expectIn=b"1234567890"*511)
