[New-bugs-announce] [issue11798] Test cases not garbage collected after run

Fabio Zadrozny report at bugs.python.org
Thu Apr 7 18:15:57 CEST 2011


New submission from Fabio Zadrozny <fabioz at users.sourceforge.net>:

Right now, when doing a test case, one must clear all the variables created in the test class, and I believe this shouldn't be needed...

E.g.:

class Test(TestCase):
  def setUp(self):
    self.obj1 = MyObject()

  ...

  def tearDown(self):
    del self.obj1

Ideally (in my view), right after running the test, it should be garbage-collected and the explicit tearDown wouldn't be needed (as the test would garbage-collected, that reference would automatically die), because this is currently very error prone... (and probably a source of leaks for any sufficiently big test suite).

If that's accepted, I can provide a patch.

----------
components: Library (Lib)
messages: 133225
nosy: fabioz
priority: normal
severity: normal
status: open
title: Test cases not garbage collected after run
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11798>
_______________________________________


More information about the New-bugs-announce mailing list