[Patches] [ python-Patches-1501987 ] Remove randomness from test_exceptions

SourceForge.net noreply at sourceforge.net
Wed Jun 7 09:00:18 CEST 2006


Patches item #1501987, was opened at 2006-06-06 23:09
Message generated for change (Settings changed) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1501987&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: Tests
Group: Python 2.5
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Žiga Seilnacht (zseil)
Assigned to: Nobody/Anonymous (nobody)
Summary: Remove randomness from test_exceptions

Initial Comment:

Recently test_exceptions was reporting random
memory leaks. It seems that this was caused
by the pickling part of testAttributes, which
uses a random integer for pickling protocol.
With this patch applied, I couldn't reproduce
the leak anymore, although I didn't run it 666
times.
The patch also includes a fix for the pickling
part of the test (previously it was checking
the attributes of the original exception, not
the unpickled one), removes another unused
import and moves all the imports to the
top of the file.

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

>Comment By: Tim Peters (tim_one)
Date: 2006-06-07 03:00

Message:
Logged In: YES 
user_id=31435

Woo hoo!  This appears to cure the oddball "leaks" for me
too, but no idea why.  Outstanding anyway ;-)

I fiddled the patch a bit to exercise both pickle and
cPickle,  and to use pickle.HIGHEST_PROTOCOL instead of the
hardcoded 2.  Checked in as revision 46705 on the trunk. 
Thank you!

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

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


More information about the Patches mailing list