Skip to content

bpo-23890: Fix ref cycles in TestCase.assertRaises() #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2017
Merged

bpo-23890: Fix ref cycles in TestCase.assertRaises() #193

merged 1 commit into from
Mar 27, 2017

Conversation

vstinner
Copy link
Member

bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
reference cycle to not keep objects alive longer than expected.

@voidspace
Copy link
Contributor

Do the new tests fail without the fix? It isn't immediately clear to me how the fix works, I imagine it's round clearing the references that would be kept alive in the frame though the traceback. If the tests fail without the fix and pass with them then the fix looks good to me.

@tinomist
Copy link

tinomist commented Feb 21, 2017 via email

@vstinner
Copy link
Member Author

vstinner commented Feb 22, 2017 via email

@ncoghlan
Copy link
Contributor

Well that's just far too straightforward an approach to fixing this :)

bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
reference cycle to not keep objects alive longer than expected.
@vstinner
Copy link
Member Author

I rebased my change to fix the usual merge conflict on Misc/NEWS.

@vstinner vstinner merged commit bbd3cf8 into python:master Mar 27, 2017
@vstinner vstinner deleted the bpo-23890 branch March 27, 2017 22:56
@vstinner
Copy link
Member Author

3.6 backport: #858

@vstinner vstinner changed the title Fix ref cycles in TestCase.assertRaises() bpo-23890: Fix ref cycles in TestCase.assertRaises() Jun 15, 2017
vstinner added a commit that referenced this pull request Jun 15, 2017
bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
reference cycle to not keep objects alive longer than expected.
(cherry picked from commit bbd3cf8)
akruis pushed a commit to akruis/cpython that referenced this pull request Dec 27, 2018
The macros PyTasklet_CheckExact(op) and PyChannel_CheckExact(op)
contained a reference to a non existing variable.
akruis pushed a commit to akruis/cpython that referenced this pull request Jan 20, 2019
The macros PyTasklet_CheckExact(op) and PyChannel_CheckExact(op)
contained a reference to a non existing variable.

(cherry picked from commit 4599c9c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants