[Python-Dev] unittest.TestSuite holding references to unittest.TestCase instances too long (original) (raw)

Matt McClure matthewlmcclure at gmail.com
Sat Aug 3 16:27:30 CEST 2013


Michael Foord <fuzzyman voidspace.org.uk> writes:

On 2 Aug 2013, at 19:19, Antoine Pitrou <solipsis pitrou.net> wrote: > The patch is basically ready for commit, except for a possible doc > addition, no?

Looks to be the case, reading the patch it looks fine. I'm currently on holiday until Monday. If anyone is motivated to do the docs too and commit that would be great. Otherwise I'll get to it on my return.

It looks like the patch is based on what will become 3.4. Would backporting it to 2.7 be feasible? What's involved in doing so?

I took a crack at the docs.

HG changeset patch

User Matt McClure <matthewlmcclure at gmail.com>

Date 1375538965 14400

Node ID d748d70201929288c230862da4dbdba33d61ae9f

Parent bf43956356ffe93e75ffdd5a7a8164fc68cf14ae

[11798] Document TestSuite.{iter, run} changes

diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1470,15 +1470,24 @@

   Tests grouped by a :class:`TestSuite` are always accessed by

iteration. Subclasses can lazily provide tests by overriding :meth:__iter__. Note

the

should

a

preserve

directly rather than through iteration, so overriding :meth:__iter__ wasn't sufficient for providing tests.

restore

diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py --- a/Lib/unittest/suite.py +++ b/Lib/unittest/suite.py @@ -65,6 +65,7 @@ return result

 def _removeTestAtIndex(self, index):

-- Matt McClure http://matthewlmcclure.com http://www.mapmyfitness.com/profile/matthewlmcclure -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130803/23d10a4a/attachment.html>



More information about the Python-Dev mailing list