Commit 0b7a5054 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 e2ccbd1f
......@@ -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
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