|
1 | 1 | # Python test set -- part 6, built-in types |
2 | 2 |
|
3 | | -from test.support import run_unittest, run_with_locale, cpython_only |
| 3 | +from test.support import run_unittest, run_with_locale |
4 | 4 | import collections |
5 | 5 | import pickle |
6 | 6 | import locale |
@@ -1170,31 +1170,9 @@ def test_pickle(self): |
1170 | 1170 | self.assertEqual(ns, ns_roundtrip, pname) |
1171 | 1171 |
|
1172 | 1172 |
|
1173 | | -class SharedKeyTests(unittest.TestCase): |
1174 | | - |
1175 | | - @cpython_only |
1176 | | - def test_subclasses(self): |
1177 | | - # Verify that subclasses can share keys (per PEP 412) |
1178 | | - class A: |
1179 | | - pass |
1180 | | - class B(A): |
1181 | | - pass |
1182 | | - |
1183 | | - a, b = A(), B() |
1184 | | - self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b))) |
1185 | | - self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({})) |
1186 | | - a.x, a.y, a.z, a.w = range(4) |
1187 | | - self.assertNotEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(b))) |
1188 | | - a2 = A() |
1189 | | - self.assertEqual(sys.getsizeof(vars(a)), sys.getsizeof(vars(a2))) |
1190 | | - self.assertLess(sys.getsizeof(vars(a)), sys.getsizeof({})) |
1191 | | - b.u, b.v, b.w, b.t = range(4) |
1192 | | - self.assertLess(sys.getsizeof(vars(b)), sys.getsizeof({})) |
1193 | | - |
1194 | | - |
1195 | 1173 | def test_main(): |
1196 | 1174 | run_unittest(TypesTests, MappingProxyTests, ClassCreationTests, |
1197 | | - SimpleNamespaceTests, SharedKeyTests) |
| 1175 | + SimpleNamespaceTests) |
1198 | 1176 |
|
1199 | 1177 | if __name__ == '__main__': |
1200 | 1178 | test_main() |
0 commit comments