diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-03-17 16:20:12 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-03-17 16:20:12 -0500 |
commit | 0e16a2ef473a33f4e977b477b25ad6016427de47 (patch) | |
tree | b45fe5cc538331255581603065aa0d1750af612b /Lib/test/test_types.py | |
parent | 7db2d3f15a3292cbe2f1d44685dfca709b6e31b3 (diff) | |
download | cpython-0e16a2ef473a33f4e977b477b25ad6016427de47.tar.gz |
move SharedKeyTests to test_descr
Diffstat (limited to 'Lib/test/test_types.py')
-rw-r--r-- | Lib/test/test_types.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 18e6b0a89c..ec10752e6a 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -1,6 +1,6 @@ # Python test set -- part 6, built-in types -from test.support import run_unittest, run_with_locale, cpython_only +from test.support import run_unittest, run_with_locale import collections import pickle import locale @@ -1170,31 +1170,9 @@ class SimpleNamespaceTests(unittest.TestCase): self.assertEqual(ns, ns_roundtrip, pname) -class SharedKeyTests(unittest.TestCase): - - @cpython_only - def test_subclasses(self): - # Verify that subclasses can share keys (per PEP 412) - class A: - pass - class B(A): - pass - - a, b = A(), B() - self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b))) - self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({})) - a.x, a.y, a.z, a.w = range(4) - self.assertNotEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b))) - a2 = A() - self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(a2))) - self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({})) - b.u, b.v, b.w, b.t = range(4) - self.assertLess(sys.getsizeof(vars(b)), sys.getsizeof({})) - - def test_main(): run_unittest(TypesTests, MappingProxyTests, ClassCreationTests, - SimpleNamespaceTests, SharedKeyTests) + SimpleNamespaceTests) if __name__ == '__main__': test_main() |