mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
Merged revisions 82303 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r82303 | benjamin.peterson | 2010-06-27 17:40:26 -0500 (Sun, 27 Jun 2010) | 1 line mark tracking tests as implementation details ........
This commit is contained in:
parent
5a6214afe2
commit
02d7806a81
1 changed files with 4 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ def _tracked(self, t):
|
||||||
gc.collect()
|
gc.collect()
|
||||||
self.assertTrue(gc.is_tracked(t), t)
|
self.assertTrue(gc.is_tracked(t), t)
|
||||||
|
|
||||||
|
@support.cpython_only
|
||||||
def test_track_literals(self):
|
def test_track_literals(self):
|
||||||
# Test GC-optimization of tuple literals
|
# Test GC-optimization of tuple literals
|
||||||
x, y, z = 1.5, "a", []
|
x, y, z = 1.5, "a", []
|
||||||
|
|
@ -136,16 +137,19 @@ def check_track_dynamic(self, tp, always_track):
|
||||||
self._tracked(tp(tuple([obj]) for obj in [x, y, z]))
|
self._tracked(tp(tuple([obj]) for obj in [x, y, z]))
|
||||||
self._tracked(tuple(tp([obj]) for obj in [x, y, z]))
|
self._tracked(tuple(tp([obj]) for obj in [x, y, z]))
|
||||||
|
|
||||||
|
@support.cpython_only
|
||||||
def test_track_dynamic(self):
|
def test_track_dynamic(self):
|
||||||
# Test GC-optimization of dynamically constructed tuples.
|
# Test GC-optimization of dynamically constructed tuples.
|
||||||
self.check_track_dynamic(tuple, False)
|
self.check_track_dynamic(tuple, False)
|
||||||
|
|
||||||
|
@support.cpython_only
|
||||||
def test_track_subtypes(self):
|
def test_track_subtypes(self):
|
||||||
# Tuple subtypes must always be tracked
|
# Tuple subtypes must always be tracked
|
||||||
class MyTuple(tuple):
|
class MyTuple(tuple):
|
||||||
pass
|
pass
|
||||||
self.check_track_dynamic(MyTuple, True)
|
self.check_track_dynamic(MyTuple, True)
|
||||||
|
|
||||||
|
@support.cpython_only
|
||||||
def test_bug7466(self):
|
def test_bug7466(self):
|
||||||
# Trying to untrack an unfinished tuple could crash Python
|
# Trying to untrack an unfinished tuple could crash Python
|
||||||
self._not_tracked(tuple(gc.collect() for i in range(101)))
|
self._not_tracked(tuple(gc.collect() for i in range(101)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue