[Patches] [ python-Patches-1691032 ] Migrate test_minidom.py to unittest

SourceForge.net noreply at sourceforge.net
Fri Apr 20 13:48:29 CEST 2007


Patches item #1691032, was opened at 2007-03-30 00:15
Message generated for change (Settings changed) made by jorend
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1691032&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.6
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: Jason Orendorff (jorend)
Assigned to: Nobody/Anonymous (nobody)
Summary: Migrate test_minidom.py to unittest

Initial Comment:
Update Lib/test/test_minidom.py to use the unittest module.

Also:  I noticed the test_minidom.py contains some code (now long dead) to check for reference cycles.  The code is active only when Node.allnodes exists; this hasn't existed for over four years now.

After re-implementing that test using gc.DEBUG_SAVEALL, I found that many tests failed because of missing unlink() calls.  I added them.

After that, one test was still failing.  This is because expatbuilder.parseString() and friends do not clean up some cyclic references on error.  The patch includes a fix for that (in Lib/xml/dom/expatbuilder.py).  An alternative would be to ditch the cycle-checking test entirely.  I can submit a patch that does that instead, if desired.




----------------------------------------------------------------------

>Comment By: Jason Orendorff (jorend)
Date: 2007-04-20 07:48

Message:
Logged In: YES 
user_id=18139
Originator: YES

There's nothing active here.  This should just be Closed Rejected.


----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-04-19 02:29

Message:
Logged In: YES 
user_id=33168
Originator: NO

Jason, can you clarify your last comment.  Wrt the "change [not] worth
making", do you mean this patch or a different change?  I just want to know
what in this patch is still active and needs review before spending time. 
Thanks.

----------------------------------------------------------------------

Comment By: Jason Orendorff (jorend)
Date: 2007-04-04 22:01

Message:
Logged In: YES 
user_id=18139
Originator: YES

Collin:  Thanks for taking the time to look at this.

I don't think this change is worth making.  I've started working on some
new features in minidom and it seems like every time I exercise a new piece
of code, the gc finds a small number of objects in cycles.  For example,
parseFragmentString() seems to leave a few objects (even with
expatbuilder.second.patch).  We're just going to have to live with it--  I
don't think anyone has time or desire to hunt down them all down.


----------------------------------------------------------------------

Comment By: Jason Orendorff (jorend)
Date: 2007-04-01 17:18

Message:
Logged In: YES 
user_id=18139
Originator: YES

File Added: expatbuilder.second.patch

----------------------------------------------------------------------

Comment By: Jason Orendorff (jorend)
Date: 2007-04-01 17:18

Message:
Logged In: YES 
user_id=18139
Originator: YES

OK, I've attached two new patches.

test_minidom.second.patch - Changes "confirm" to "assert_" or
"assertEquals", breaks multi-line assertions into many one-line assertions,
adds convenience methods "assertSameNode" and "assertNotSameNode", etc. 
Also replaces the Node.allnodes test with gc-based test and adds a few
calls to unlink().

expatbuilder.second.patch - Fixes the test failure discovered by the new
gc testing.

File Added: test_minidom.second.patch

----------------------------------------------------------------------

Comment By: Collin Winter (collinwinter)
Date: 2007-03-30 02:49

Message:
Logged In: YES 
user_id=1344176
Originator: NO

test_minidom already uses unittest (as of patch #1683397, SVN r54603).
Could you update your patch to the latest trunk revision?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1691032&group_id=5470


More information about the Patches mailing list