diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-07 18:08:34 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-07 18:08:34 (GMT) |
commit | 88f64f392c8fe8cb41322c2ea14483fa0c567eaa (patch) | |
tree | a6c35327c4ffc006cdaa2ea687534feff3e3a3e4 /Lib/test/test_ipaddress.py | |
parent | a5f3ad8c05c115266834be8716c19301004a31a0 (diff) | |
download | cpython-88f64f392c8fe8cb41322c2ea14483fa0c567eaa.zip cpython-88f64f392c8fe8cb41322c2ea14483fa0c567eaa.tar.gz cpython-88f64f392c8fe8cb41322c2ea14483fa0c567eaa.tar.bz2 |
Issue #23103: Reduced the memory consumption of IPv4Address and IPv6Address.
Diffstat (limited to 'Lib/test/test_ipaddress.py')
-rw-r--r-- | Lib/test/test_ipaddress.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index e985329..c217d36 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -11,6 +11,7 @@ import functools import operator import pickle import ipaddress +import weakref class BaseTestCase(unittest.TestCase): @@ -259,6 +260,9 @@ class AddressTestCase_v4(BaseTestCase, CommonTestMixin_v4): def test_pickle(self): self.pickle_test('192.0.2.1') + def test_weakref(self): + weakref.ref(self.factory('192.0.2.1')) + class AddressTestCase_v6(BaseTestCase, CommonTestMixin_v6): factory = ipaddress.IPv6Address @@ -394,6 +398,9 @@ class AddressTestCase_v6(BaseTestCase, CommonTestMixin_v6): def test_pickle(self): self.pickle_test('2001:db8::') + def test_weakref(self): + weakref.ref(self.factory('2001:db8::')) + class NetmaskTestMixin_v4(CommonTestMixin_v4): """Input validation on interfaces and networks is very similar""" |