diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-07-31 21:40:15 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2019-07-31 21:40:15 +0200 |
commit | fb824beb47f0e58463bb9a4b4b50bd804f30b9f2 (patch) | |
tree | ddd5036bcb6125b4d592eb6e4e3399de1b24f8a4 /tests | |
parent | fc10c68fabf184116aaf1915e41a4f5fd21a4a27 (diff) | |
download | pyasn1-fb824beb47f0e58463bb9a4b4b50bd804f30b9f2.tar.gz |
Fix failing unit tests on Py25
Diffstat (limited to 'tests')
-rw-r--r-- | tests/type/test_univ.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/type/test_univ.py b/tests/type/test_univ.py index de7cdee..0092588 100644 --- a/tests/type/test_univ.py +++ b/tests/type/test_univ.py @@ -150,13 +150,18 @@ class NoValueTestCase(BaseTestCase): try: if hasattr(sys, 'getsizeof'): sys.getsizeof(univ.noValue) - else: + + # TODO: remove when Py2.5 support is gone + elif sys.version_info > (2, 6): raise unittest.SkipTest("no sys.getsizeof() method") except PyAsn1Error: assert False, 'sizeof failed for NoValue object' + except TypeError: - raise unittest.SkipTest("sys.getsizeof() raises TypeError") + # TODO: remove when Py2.5 support is gone + if sys.version_info > (2, 6): + raise unittest.SkipTest("sys.getsizeof() raises TypeError") class IntegerTestCase(BaseTestCase): @@ -554,8 +559,10 @@ class OctetStringUnicodeErrorTestCase(BaseTestCase): except PyAsn1UnicodeEncodeError: pass + # TODO: remove when Py2.5 support is gone else: - assert False, 'Unicode encoding error not caught' + if sys.version_info > (2, 6): + assert False, 'Unicode encoding error not caught' def testDecodeError(self): serialized = ints2octs((0xff, 0xfe)) @@ -566,8 +573,10 @@ class OctetStringUnicodeErrorTestCase(BaseTestCase): except PyAsn1UnicodeDecodeError: pass + # TODO: remove when Py2.5 support is gone else: - assert False, 'Unicode decoding error not caught' + if sys.version_info > (2, 6): + assert False, 'Unicode decoding error not caught' class OctetStringWithUtf8TestCase(OctetStringWithUnicodeMixIn, BaseTestCase): |