diff options
author | Vincent Bernat <vincent@bernat.im> | 2017-12-26 10:35:48 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-12-26 10:35:48 +0100 |
commit | 6910ce9a44b6523c2f3787a279dbf8f47c3e2cca (patch) | |
tree | 52c2be0e2af9b9f845ed570ee249f6089bec3424 /tests | |
parent | 1f38b8e5d62dab7ff4ddabc425eeef908a78a4c3 (diff) | |
download | pyasn1-6910ce9a44b6523c2f3787a279dbf8f47c3e2cca.tar.gz |
sys.getsizeof() may raise TypeError (#117)
Not all implementations have to implement getsizeof() and may raise
TypeError instead. Notably, Pypy will always raise TypeError (unless a
default value is provided).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/type/test_univ.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/type/test_univ.py b/tests/type/test_univ.py index 1999706..dc7d2cc 100644 --- a/tests/type/test_univ.py +++ b/tests/type/test_univ.py @@ -149,9 +149,13 @@ class NoValueTestCase(BaseTestCase): try: if hasattr(sys, 'getsizeof'): sys.getsizeof(univ.noValue) + else: + 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") class IntegerTestCase(BaseTestCase): |