[pypy-svn] pypy simplify-conftest: Fix tests in pypy/doc
amauryfa
commits-noreply at bitbucket.org
Mon Jan 10 17:49:25 CET 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: simplify-conftest
Changeset: r40561:f984592cf906
Date: 2011-01-10 17:47 +0100
http://bitbucket.org/pypy/pypy/changeset/f984592cf906/
Log: Fix tests in pypy/doc
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -326,20 +326,23 @@
__multicall__.execute()
- if not getattr(item.obj, 'dont_track_allocations', False):
- leakfinder.start_tracking_allocations()
+ if isinstance(item, py.test.collect.Function):
+ if not getattr(item.obj, 'dont_track_allocations', False):
+ leakfinder.start_tracking_allocations()
def pytest_runtest_teardown(__multicall__, item):
__multicall__.execute()
- if (not getattr(item.obj, 'dont_track_allocations', False)
- and leakfinder.TRACK_ALLOCATIONS):
- item._pypytest_leaks = leakfinder.stop_tracking_allocations(False)
- else: # stop_tracking_allocations() already called
- item._pypytest_leaks = None
- # check for leaks, but only if the test passed so far
- if item._pypytest_leaks:
- raise leakfinder.MallocMismatch(item._pypytest_leaks)
+ if isinstance(item, py.test.collect.Function):
+ if (not getattr(item.obj, 'dont_track_allocations', False)
+ and leakfinder.TRACK_ALLOCATIONS):
+ item._pypytest_leaks = leakfinder.stop_tracking_allocations(False)
+ else: # stop_tracking_allocations() already called
+ item._pypytest_leaks = None
+
+ # check for leaks, but only if the test passed so far
+ if item._pypytest_leaks:
+ raise leakfinder.MallocMismatch(item._pypytest_leaks)
if 'pygame' in sys.modules:
assert option.view, ("should not invoke Pygame "
More information about the Pypy-commit
mailing list