Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
422eb9dc
Commit
422eb9dc
authored
May 05, 2005
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added basic cyclic GC test. Note that this test would fail in
Zope 2.7 and earlier.
parent
c40ffee0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
lib/python/ExtensionClass/tests.py
lib/python/ExtensionClass/tests.py
+28
-0
No files found.
lib/python/ExtensionClass/tests.py
View file @
422eb9dc
...
@@ -807,6 +807,34 @@ def test___of__set_after_creation():
...
@@ -807,6 +807,34 @@ def test___of__set_after_creation():
"""
"""
def
test_Basic_gc
():
"""Test to make sure that EC instances participate in GC
>>> from ExtensionClass import Base
>>> import gc
>>> class C1(Base):
... pass
...
>>> class C2(Base):
... def __del__(self):
... print 'removed'
...
>>> a=C1()
>>> a.b = C1()
>>> a.b.a = a
>>> a.b.c = C2()
>>> thresholds = gc.get_threshold()
>>> gc.set_threshold(0)
>>> ignore = gc.collect()
>>> del a
>>> ignored = gc.collect()
removed
>>> ignored > 0
True
>>> gc.set_threshold(*thresholds)
"""
from
zope.testing.doctest
import
DocTestSuite
from
zope.testing.doctest
import
DocTestSuite
import
unittest
import
unittest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment