Commit f6d31cb8 authored by Benjamin Peterson's avatar Benjamin Peterson

cpython only gc tests

parent 7ff78257
...@@ -561,6 +561,7 @@ class DictTest(unittest.TestCase): ...@@ -561,6 +561,7 @@ class DictTest(unittest.TestCase):
gc.collect() gc.collect()
self.assertTrue(gc.is_tracked(t), t) self.assertTrue(gc.is_tracked(t), t)
@test_support.cpython_only
def test_track_literals(self): def test_track_literals(self):
# Test GC-optimization of dict literals # Test GC-optimization of dict literals
x, y, z, w = 1.5, "a", (1, None), [] x, y, z, w = 1.5, "a", (1, None), []
...@@ -578,6 +579,7 @@ class DictTest(unittest.TestCase): ...@@ -578,6 +579,7 @@ class DictTest(unittest.TestCase):
self._tracked({1: {}}) self._tracked({1: {}})
self._tracked({1: set()}) self._tracked({1: set()})
@test_support.cpython_only
def test_track_dynamic(self): def test_track_dynamic(self):
# Test GC-optimization of dynamically-created dicts # Test GC-optimization of dynamically-created dicts
class MyObject(object): class MyObject(object):
...@@ -641,6 +643,7 @@ class DictTest(unittest.TestCase): ...@@ -641,6 +643,7 @@ class DictTest(unittest.TestCase):
d.update([(x, y), (z, w)]) d.update([(x, y), (z, w)])
self._tracked(d) self._tracked(d)
@test_support.cpython_only
def test_track_subtypes(self): def test_track_subtypes(self):
# Dict subtypes are always tracked # Dict subtypes are always tracked
class MyDict(dict): class MyDict(dict):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment