hRobert12 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

utilities for testing leaks #146

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

In another life I have written some simple test methods for testing leaked
objects, and survival of objects. You can find the five relevant methods
here:
http://twistedmatrix.com/trac/browser/branches/libevent-1930-3/twisted/test/test
_libevent.py?rev=22266#L219

I was thinking it would be nice if nose provided such utility functions.
The one difficulty I see in just re-using the aforementioned methods is
that nose does not mandate subclassing a given testcase class, and using
global containers would be ugly... Any ideas?

Original issue reported on code.google.com by antoine.pitrou on 6 Jan 2008 at 4:10

GoogleCodeExporter commented 8 years ago
Here is a proposal implementation, with two APIs: an object-oriented API, and a
context manager (for use with the new "with" statement). The context manager 
API is
simpler to use but gives the same functionality.

I'm not sure the naming of the API is perfect.

Unit tests are included.

Original comment by antoine.pitrou on 6 Jan 2008 at 9:51

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by j...@pobox.com on 24 Mar 2008 at 2:41