Commit 6c350c9b authored by Jim Fulton's avatar Jim Fulton

The stdlib doctest.DocTestSuite is broken in such a way that you can't

repeat tests.  Provide an environment variable to use the doctest from
zope.testing.
parent 257e3659
...@@ -109,8 +109,35 @@ Peristent meta classes work too: ...@@ -109,8 +109,35 @@ Peristent meta classes work too:
""" """
def cache_invalidate_used_to_leak_None_ref():
"""Persistent weak references
>>> import transaction
>>> import ZODB.tests.util
>>> db = ZODB.tests.util.DB()
>>> conn = db.open()
>>> conn.root.p = p = conn.root().__class__()
>>> transaction.commit()
>>> import sys
>>> old = sys.getrefcount(None)
>>> conn._cache.invalidate(p._p_oid)
>>> sys.getrefcount(None) - old
0
>>> db.close()
"""
import os
if os.environ.get('USE_ZOPE_TESTING_DOCTEST'):
from zope.testing.doctest import DocTestSuite
else:
from doctest import DocTestSuite
from doctest import DocTestSuite
import unittest import unittest
def test_suite(): def test_suite():
......
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