Skip to content

Commit

Permalink
Disable assertion iff running under coverage
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
mgedmin committed Jan 12, 2015
1 parent 9811ff9 commit a130173
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ZODB/tests/testCache.py
Expand Up @@ -364,7 +364,12 @@ def add(key, obj):
# same object, different keys
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):
jar2 = StubDataManager()
Expand Down

0 comments on commit a130173

Please sign in to comment.