homepage

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.

classification
Title: Avoid using a pseudo-dict for _type_equality_funcs in unittest
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: MarkRoddy, benjamin.peterson, eric.araujo, ezio.melotti, gz, michael.foord, python-dev
Priority: normal Keywords: patch

Created on 2011年07月13日 00:05 by gz, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
avoid_TestCase_refcycle.diff gz, 2011年07月13日 00:20
Messages (10)
msg140217 - (view) Author: Martin (gz) * Date: 2011年07月13日 00:05
The fix for issue 10326 landing on Python 2.7 trunk has interfered with a hack I wrote in Bazaar to break the reference cycles the private `unittest.TestCase._type_equality_funcs` member creates.
As the change to make pickling work is nearly enough to avoid the test and the dict referencing each other, it would be good to remove that breakage and the need for the hack in the first place.
Downstream bug:
<https://bugs.launchpad.net/ubuntu/+source/bzr/+bug/809048>
msg140218 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011年07月13日 00:08
It isn't clear to me exactly what fix you are suggesting for Python 2.7?
msg140219 - (view) Author: Martin (gz) * Date: 2011年07月13日 00:12
Michael: See attached patch, that should merge up to Python 3 without too much pain as well.
msg140220 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011年07月13日 00:19
New changeset 02a591131360 by Benjamin Peterson in branch '2.7':
this can be done without a custom dict (also fixes #12544)
http://hg.python.org/cpython/rev/02a591131360
New changeset 842f5ed06255 by Benjamin Peterson in branch '3.2':
this can be done without a custom dict (also fixes #12544)
http://hg.python.org/cpython/rev/842f5ed06255
New changeset 47a36d2d2b44 by Benjamin Peterson in branch 'default':
merge 3.2 (#12544)
http://hg.python.org/cpython/rev/47a36d2d2b44 
msg140221 - (view) Author: Martin (gz) * Date: 2011年07月13日 00:20
...typo in the first patch, this one should be okay. But... already landed without the testcase?
msg140255 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011年07月13日 14:27
What’s the typo?
About the test case: Benjamin probably judged that testing this internal detail was not worth it, as long as the code was readable and working.
msg140256 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011年07月13日 14:29
Actually, what happened was I saw the bug report, didn't see your patch, and started working on my own patch. I see we came to roughly the same conclusion, though. :) About the test, I'm not sure testcases having no cyclic references is part of the guarantee of the API. Perhaps Michael can chime in on that.
msg140401 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011年07月15日 10:58
I wouldn't object to having a cyclic reference test for TestCase, although if it ever becomes a problem for the development of unittest we may have to disable it again. I think Benjamin said he would like to modify the test from Martin's patch.
msg140413 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011年07月15日 14:50
Done.
2011年7月15日 Michael Foord <report@bugs.python.org>:
>
> Michael Foord <michael@voidspace.org.uk> added the comment:
>
> I wouldn't object to having a cyclic reference test for TestCase, although if it ever becomes a problem for the development of unittest we may have to disable it again. I think Benjamin said he would like to modify the test from Martin's patch.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue12544>
> _______________________________________
>
msg140414 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011年07月15日 15:03
FTR, some assertions about GC are embedded in the tests, for example test_set.
History
Date User Action Args
2022年04月11日 14:57:19adminsetgithub: 56753
2011年07月15日 15:03:01eric.araujosetmessages: + msg140414
2011年07月15日 14:50:35benjamin.petersonsetmessages: + msg140413
2011年07月15日 10:58:36michael.foordsetmessages: + msg140401
2011年07月13日 14:41:22ezio.melottisetnosy: + ezio.melotti
2011年07月13日 14:30:00benjamin.petersonsetmessages: + msg140256
2011年07月13日 14:27:03eric.araujosetnosy: + eric.araujo, benjamin.peterson
messages: + msg140255
2011年07月13日 00:20:27gzsetfiles: + avoid_TestCase_refcycle.diff

messages: + msg140221
2011年07月13日 00:19:54benjamin.petersonsetstatus: open -> closed
resolution: fixed
2011年07月13日 00:19:07python-devsetnosy: + python-dev
messages: + msg140220
2011年07月13日 00:15:51gzsetfiles: - avoid_TestCase_refcycle.diff
2011年07月13日 00:12:25gzsetmessages: + msg140219
2011年07月13日 00:11:28gzsetfiles: + avoid_TestCase_refcycle.diff
keywords: + patch
2011年07月13日 00:08:57michael.foordsetassignee: michael.foord
messages: + msg140218
2011年07月13日 00:05:53gzcreate

AltStyle によって変換されたページ (->オリジナル) /