[issue11798] Test cases not garbage collected after run

2017-06-30 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 22d4e8fb99b16657eabfe7f9fee2d40a5ef882f6 by Victor Stinner in branch '3.6': bpo-30813: Fix unittest when hunting refleaks (#2502) (#2505) https://github.com/python/cpython/commit/22d4e8fb99b16657eabfe7f9fee2d40a5ef882f6 -- _

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 714afccf6e7644d21ce1a39e90bf83cb0c9a74f1 by Victor Stinner in branch '3.5': bpo-30813: Fix unittest when hunting refleaks (#2502) (#2506) https://github.com/python/cpython/commit/714afccf6e7644d21ce1a39e90bf83cb0c9a74f1 -- _

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2574 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2570 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3 by Victor Stinner in branch 'master': bpo-30813: Fix unittest when hunting refleaks (#2502) https://github.com/python/cpython/commit/e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3 -- __

[issue11798] Test cases not garbage collected after run

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2563 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue11798] Test cases not garbage collected after run

2014-09-21 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Michael Foord
Michael Foord added the comment: Ah yes, I see - sorry. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is used, see countTestCases(). -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue11798] Test cases not garbage collected after run

2013-12-28 Thread Michael Foord
Michael Foord added the comment: What's the purpose of _removed_tests in your fix, it doesn't appear to be used? -- ___ Python tracker ___ ___

[issue11798] Test cases not garbage collected after run

2013-12-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset b668c409c10a by Antoine Pitrou in branch 'default': Fix breakage in TestSuite.countTestCases() introduced by issue #11798. http://hg.python.org/cpython/rev/b668c409c10a -- ___ Python tracker

[issue11798] Test cases not garbage collected after run

2013-12-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: No answer to Xavier's regression? The way this issue is being treated is a bit worrying. -- ___ Python tracker ___

[issue11798] Test cases not garbage collected after run

2013-12-14 Thread Xavier de Gaye
Xavier de Gaye added the comment: This seems to break BaseTestSuite.countTestCases when invoked after the TestSuite has been run: ... File "Lib/unittest/suite.py", line 42, in countTestCases cases += test.countTestCases() AttributeError: 'NoneType' object has no attribute 'countTestCases

[issue11798] Test cases not garbage collected after run

2013-10-06 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue11798] Test cases not garbage collected after run

2013-10-06 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Unfortunately the TestSuite.addTests api iterates over a suite to add > new tests. i.e. the code that builds a TestSuite for module probably > already iterates over the suites returned by > TestLoader.loadTestsFromTestCase - so the change would need to be > mor

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: Having TestLoader.loadTestsFromTestCase() return a "lazy suite" that defers testcase instantiation until iteration is a nice idea. Unfortunately the TestSuite.addTests api iterates over a suite to add new tests. i.e. the code that builds a TestSuite for module

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: That said, I agree that the __dict__ proposal is a hack, but as is the current _removetestAtIndex mechanism. The only clean solution I can think of would be to have two separate classes: - a TestSpec which contains execution-independent data about a test case,

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: Ah right, my mistake. Before setUp there shouldn't be test state. (Although tests are free to do whatever they want in __init__ too and I've seen plenty of TestCase subclasses using __init__ when they should be using setUp.) Essentially though _cleanup is a bac

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If the object state includes mutable objects then restoring the > previous dictionary will just restore the same mutable (and likely > mutated) object. I don't understand what you're talking about. Which mutable objects exactly? I'm talking about copying the d

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: On 19 Sep 2013, at 14:06, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> That would only be a shallow copy, so I'm not sure it's worth the >> effort. The test has the opportunity in the setUp to ensure that >> initial state is correct - so I

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > That would only be a shallow copy, so I'm not sure it's worth the > effort. The test has the opportunity in the setUp to ensure that > initial state is correct - so I would leave that per test. I don't understand your objection. The concern is to get rid of ol

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: That would only be a shallow copy, so I'm not sure it's worth the effort. The test has the opportunity in the setUp to ensure that initial state is correct - so I would leave that per test. Obviously sharing state between tests is prima facie bad, but any frame

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ideally, test specification should be separate from test execution. That is, it should be possible to keep the TestCase around (or whatever instantiates it, e.g. a factory) but get rid of its per-test-execution attributes. Perhaps restoring the original __dict

[issue11798] Test cases not garbage collected after run

2013-09-16 Thread Michael Foord
Michael Foord added the comment: If we're sure suite._cleanupis a *good* api for this then fine to expose it (and document) it as a public api. I'll take a look at it in a bit. Test suites will still have to do *some* monkeying around to set suite.cleanup (presumably in load_tests), so I'm no

[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, but that's not the point. Legitimate use cases can be broken by the change, so at least there should be an easy way to disable the new behaviour. -- ___ Python tracker __

[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Michael Foord
Michael Foord added the comment: Can that be fixed in tulip? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note: ideally, the --forever flag wouldn't reuse TestCase instances but rather create new ones. -- ___ Python tracker ___ _

[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: For the record, this change broke the --forever option in Tulip's test script, which is why I'm caring. Setting the _cleanup flag to False seems to restore old behaviour, except that _cleanup is (obviously) a private API. -- __

[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'd rather not propagate more options all the way through, especially > as this is some thing that should be decided by the test framework and > is unlikely to be something you want to turn on and off per test run > (which is what command line options are for

[issue11798] Test cases not garbage collected after run

2013-09-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: Ok. Let's close issue. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue11798] Test cases not garbage collected after run

2013-09-01 Thread Michael Foord
Michael Foord added the comment: I'd rather not propagate more options all the way through, especially as this is some thing that should be decided by the test framework and is unlikely to be something you want to turn on and off per test run (which is what command line options are for). Frame

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: Now 'regrtest.py -j4 -R : ' passes. Do we need to add parameter for disabling tests cleanup to TestSuite, TestLoader and TestProgrm constructors? -- ___ Python tracker ___

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 39781c3737f8 by Andrew Svetlov in branch 'default': Issue #11798: fix tests for regrtest -R : http://hg.python.org/cpython/rev/39781c3737f8 -- ___ Python tracker _

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7035b5d8fc0f by Tim Peters in branch 'default': Back out 868ad6fa8e68 - it left all the buildbots failing. http://hg.python.org/cpython/rev/7035b5d8fc0f -- ___ Python tracker

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Tim Peters
Tim Peters added the comment: All the buildbots are failing due to changeset 868ad6fa8e68 - I'm going to back it out. -- nosy: +tim.peters ___ Python tracker ___ ___

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Er... your latest commit broke this issue's own tests! -- nosy: +pitrou ___ Python tracker ___ ___ P

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 868ad6fa8e68 by Andrew Svetlov in branch 'default': Temporary disable tests cleanup (issue 11798). http://hg.python.org/cpython/rev/868ad6fa8e68 -- ___ Python tracker

[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: Good catch! That's because -R run the same test suite several times. I'm working on patch. -- resolution: fixed -> status: closed -> open ___ Python tracker __

[issue11798] Test cases not garbage collected after run

2013-08-30 Thread Meador Inge
Meador Inge added the comment: I see some regressions when reference leak hunting with -j './python -j8 -R :' test test_ast crashed -- Traceback (most recent call last): File "/home/meadori/src/cpython/Lib/test/regrtest.py", line 1265, in runtest_inne r huntrleaks) File "/home/meadori/sr

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry. Tests are fixed now. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17f23cf029cf by Andrew Svetlov in branch 'default': Fix tests for #11798 http://hg.python.org/cpython/rev/17f23cf029cf -- ___ Python tracker __

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread Matt McClure
Matt McClure added the comment: This might fix it (untested): diff -r d748d7020192 Lib/test/test_doctest.py --- a/Lib/test/test_doctest.py Sat Aug 03 10:09:25 2013 -0400 +++ b/Lib/test/test_doctest.py Wed Aug 28 15:35:58 2013 -0400 @@ -2329,6 +2329,8 @@ Now, when we run the test: +

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread R. David Murray
R. David Murray added the comment: This seems to be producing a test failure in test_doctest. eg: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%203.x/builds/1920 -- ___ Python tracker _

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c2a37459c70 by Andrew Svetlov in branch 'default': Issue #11798: TestSuite now drops references to own tests after execution. http://hg.python.org/cpython/rev/1c2a37459c70 -- nosy: +python-dev ___ Python

[issue11798] Test cases not garbage collected after run

2013-08-28 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread R. David Murray
R. David Murray added the comment: There is no easy way to merge accounts in roundup. If you've submitted the agreement, your "*" should show up in a bit :) -- ___ Python tracker _

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Matt McClure
Matt McClure added the comment: Andrew, I signed the agreement as matthewlmcclure and as matthewlmcclure-gmail. Is there any way I can merge those two user accounts? I believe the original patch was Tom Wardill's. I just updated his patch. -- nosy: +matthewlmcclure __

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Matt, would you sign licence agreement http://www.python.org/psf/contrib/ ? The Python Software Fondation is asking all contributors to sign it. Thanks. -- ___ Python tracker _

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Michael Foord
Michael Foord added the comment: Go ahead and commit. The functionality and patch are good. -- ___ Python tracker ___ ___ Python-bugs-

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Matt, I've added new patch. Will commit it after tomorrow if nobody object. -- Added file: http://bugs.python.org/file31483/issue11798.diff ___ Python tracker

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Matt McClure
Matt McClure added the comment: Andrew, I didn't understand your message. Are you asking me to change the patch somehow? Or asking Michael to review and apply it? Best, Matt -- ___ Python tracker ___

[issue11798] Test cases not garbage collected after run

2013-08-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Looks good but review comments worth to be applied or rejected with reasonable note. -- nosy: +asvetlov ___ Python tracker ___

[issue11798] Test cases not garbage collected after run

2013-08-16 Thread Simon Charette
Changes by Simon Charette : -- nosy: +charettes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue11798] Test cases not garbage collected after run

2013-08-04 Thread Michael Foord
Michael Foord added the comment: The doc patch looks good, thanks Matt. I'll read it through properly before committing. -- ___ Python tracker ___ __

[issue11798] Test cases not garbage collected after run

2013-08-04 Thread Michael Foord
Michael Foord added the comment: This smells like a new feature to me (it's certainly a fairly significant change in behaviour) and isn't appropriate for backporting to 2.7. It can however go into unittest2. I agree with David that a destructive iteration using pop is more likely to cause bac

[issue11798] Test cases not garbage collected after run

2013-08-04 Thread Matt McClure
Changes by Matt McClure : Added file: http://bugs.python.org/file31154/11798-20130803-matthewlmcclure.patch ___ Python tracker ___ ___ Python

[issue11798] Test cases not garbage collected after run

2013-08-04 Thread Matt McClure
Matt McClure added the comment: Michael Foord voidspace.org.uk> writes: > On 2 Aug 2013, at 19:19, Antoine Pitrou 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

[issue11798] Test cases not garbage collected after run

2013-08-03 Thread R. David Murray
R. David Murray added the comment: Terry: I would not be in favor of using the normal iter, since iterating a collection doesn't normally empty it, and there may be tools that iterate a test suite outside of test execution. Adding a pop_iter method would be a backward compatibility issue, sin

[issue11798] Test cases not garbage collected after run

2013-08-03 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- nosy: -exarkun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue11798] Test cases not garbage collected after run

2013-08-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: If the iterator for 'self' were de-structive, if it removed (popped) the test from whatever structure holds it before yielding it, the messiness of enumerate and the new ._removeTestAtIndex method would not be needed and 'for test in self' would work as desire

[issue11798] Test cases not garbage collected after run

2013-05-04 Thread Guido van Rossum
Guido van Rossum added the comment: Just to be self-referential here's a link to #17908. -- nosy: +gvanrossum ___ Python tracker ___ _

[issue11798] Test cases not garbage collected after run

2012-10-02 Thread Michael Foord
Michael Foord added the comment: The patch looks good to me, although there probably needs to be a note in the TestSuite docs too. I'll apply this to Python 3.4, which leaves plenty of time for people to object. Note that people needing the old behaviour can subclass TestSuite and provide a d

[issue11798] Test cases not garbage collected after run

2012-09-30 Thread Tom Wardill
Tom Wardill added the comment: Patch attached using setting test to None after execution. -- keywords: +patch nosy: +tomwardill Added file: http://bugs.python.org/file27352/11798.patch ___ Python tracker __

[issue11798] Test cases not garbage collected after run

2012-09-28 Thread Michael Foord
Changes by Michael Foord : -- versions: +Python 3.4 -Python 2.7, Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue11798] Test cases not garbage collected after run

2011-06-01 Thread Fabio Zadrozny
Fabio Zadrozny added the comment: Sure, will try to get a patch for next week... -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue11798] Test cases not garbage collected after run

2011-05-26 Thread Michael Foord
Michael Foord added the comment: Sure, let's do it. Fabio, care to provide patch with tests and doc changes? (For 3.3.) -- ___ Python tracker ___ __

[issue11798] Test cases not garbage collected after run

2011-05-26 Thread Fabio Zadrozny
Fabio Zadrozny added the comment: So Michal, it seems no objections were raised? -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Not keeping tests alive for the whole run seems like a > good thing +1 > and either implementation seems fine to me. I slightly prefer Fabio;s assignment to None approach (for subtle reasons that I can't articulate at the moment). -- nosy: +rh

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Michael Foord
Michael Foord added the comment: Not keeping tests alive for the whole run seems like a good thing and either implementation seems fine to me. I'd be interested to hear if anyone else had any backwards compatibility concerns though. -- ___ Python t

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Here's Trial's implementation: http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py#L138 -- ___ Python tracker ___ ___

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Fabio Zadrozny
Fabio Zadrozny added the comment: The current code I use in PyDev is below -- another option could be not adding the None to the list of tests, but removing it, but I find that a bit worse because in the current way if someone tries to access it after it's ran, it'll become clear it was remov

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Michael Foord
Michael Foord added the comment: A TestSuite (which is how tests are collected to run) holds all the tests and therefore keeps them all alive for the duration of the test run. (I presume this is the issue anyway.) How would you solve this - by having calling a TestSuite (which is how a test

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: > I thought unittest was just handed a bunch of TestCase instances and couldn't > do much about insuring they were garbage collected. True. But unittest could ensure that it doesn't keep a reference to each TestCase instance after it finishes running it

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2011/4/7 Jean-Paul Calderone : > > Jean-Paul Calderone added the comment: > > Trial lets test cases get garbaged collected.  When we noticed this wasn't > happening, we treated it as a bug and fixed it.  No one ever complained about > the change.  I don't

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Fabio Zadrozny
Fabio Zadrozny added the comment: I do get the idea of the backward incompatibility, although I think it's really minor in this case. Just for some data, the pydev test runner has had a fix to clear those test cases for quite a while already and no one has complained about it (it actually ma

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Trial lets test cases get garbaged collected. When we noticed this wasn't happening, we treated it as a bug and fixed it. No one ever complained about the change. I don't see any obvious way in which an application would even be able to tell the diffe

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: You don't have to clear them; you just have to finalize them. Anyway, this is essentially impossible to do in a backward compatible way given that TestCases are expected to stay around. -- nosy: +benjamin.peterson _

[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Fabio Zadrozny
New submission from Fabio Zadrozny : Right now, when doing a test case, one must clear all the variables created in the test class, and I believe this shouldn't be needed... E.g.: class Test(TestCase): def setUp(self): self.obj1 = MyObject() ... def tearDown(self): del self.obj