Commit a1301738 authored by Marius Gedminas's avatar Marius Gedminas

Disable assertion iff running under coverage

Fixes https://github.com/zopefoundation/ZODB/issues/28
parent 9811ff90
...@@ -364,7 +364,12 @@ class CacheErrors(unittest.TestCase): ...@@ -364,7 +364,12 @@ class CacheErrors(unittest.TestCase):
# same object, different keys # same object, different keys
self.assertRaises(ValueError, add, p64(0), o) self.assertRaises(ValueError, add, p64(0), o)
self.assertEqual(sys.getrefcount(None), nones) if sys.gettrace() is None:
# 'coverage' keeps track of coverage information in a data
# structure that adds a new reference to None for each executed
# line of code, which interferes with this test. So check it
# only if we're running without coverage tracing.
self.assertEqual(sys.getrefcount(None), nones)
def testTwoCaches(self): def testTwoCaches(self):
jar2 = StubDataManager() jar2 = StubDataManager()
......
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