This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, vstinner
Date 2013-12-03.22:46:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386110800.98.0.113346130856.issue19880@psf.upfronthosting.co.za>
In-reply-to
Content
Test attached unittest_leak.py script: you will see MyException.ninstance counter increased up to 10, whereas I expect that MyException is destroyed at TestCase.run() exit.

It looks like a tricky reference cycle between:

- frames
- exc_info local variable of _Outcome.testPartExecutor() context manager
- _Outcome.errors list
- _Outclass instance

Attached unittest_workaround.patch patch works around the issue.
History
Date User Action Args
2013-12-03 22:46:41vstinnersetrecipients: + vstinner, pitrou
2013-12-03 22:46:40vstinnersetmessageid: <1386110800.98.0.113346130856.issue19880@psf.upfronthosting.co.za>
2013-12-03 22:46:40vstinnerlinkissue19880 messages
2013-12-03 22:46:40vstinnercreate