Issue 1414: Fix for refleak tests
Created on 2007-11-09 15:17 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (11)
msg57310 - (view)
Author: Christian Heimes (christian.heimes) *
Date: 2007-11-09 15:18
Date: 2007-11-09 18:44
Date: 2007-11-09 19:45
Date: 2007-11-12 17:49
Date: 2007-11-12 19:14
Date: 2007-11-12 19:20
Date: 2007-11-12 19:47
Date: 2007-11-30 19:27
Date: 2007-11-30 22:03
Date: 2007-11-30 22:08
Date: 2007-11-30 23:18
Date: 2007-11-09 15:18
The patch prevents some tests from running multiple times in a test session.msg57315 - (view) Author: Guido van Rossum (gvanrossum) *
Date: 2007-11-09 18:44
Hm, I was hoping more for patches to the C code that would make these initializations reentrant (e.g. by testing a flag in C that says "I'm already initialized").msg57321 - (view) Author: Christian Heimes (christian.heimes) *
Date: 2007-11-09 19:45
Here is a version of test_freeze that doesn't depend on stdout output on load.msg57414 - (view) Author: Guido van Rossum (gvanrossum) *
Date: 2007-11-12 17:49
Please check in the frozen-related fixes. Your changes to test_tcl break that test even when run without -R! For test_pkg, I would rather see a fix that undoes all the changes to sys.modules (note that it already restores sys.path and deletes the files it's created, but that's not enough).msg57419 - (view) Author: Christian Heimes (christian.heimes) *
Date: 2007-11-12 19:14
How do you like;
class TestPkg(unittest.TestCase):
def setUp(self):
self.root = None
self.syspath = list(sys.path)
self.sysmodules = sys.modules.copy()
def tearDown(self):
sys.path[:] = self.syspath
sys.modules.clear()
sys.modules.update(self.sysmodules)
del self.sysmodules
cleanout(self.root)
Or I could use the paranoid approach: create set from sys.modules.keys()
in setUp + tearDown and remove the items that are in the second set but
not in the first set.
msg57420 - (view)
Author: Christian Heimes (christian.heimes) *
Date: 2007-11-12 19:20
Fix for test_frozen comitted in r58953msg57422 - (view) Author: Guido van Rossum (gvanrossum) *
Date: 2007-11-12 19:47
If that makes the test pass with and without -R::, go for it! On Nov 12, 2007 11:14 AM, Christian Heimes <report@bugs.python.org> wrote: > > Christian Heimes added the comment: > > How do you like; > > class TestPkg(unittest.TestCase): > > def setUp(self): > self.root = None > self.syspath = list(sys.path) > self.sysmodules = sys.modules.copy() > > def tearDown(self): > sys.path[:] = self.syspath > sys.modules.clear() > sys.modules.update(self.sysmodules) > del self.sysmodules > cleanout(self.root) > > Or I could use the paranoid approach: create set from sys.modules.keys() > in setUp + tearDown and remove the items that are in the second set but > not in the first set. > > > __________________________________ > Tracker <report@bugs.python.org> > <http://bugs.python.org/issue1414> > __________________________________ >msg57999 - (view) Author: Guido van Rossum (gvanrossum) *
Date: 2007-11-30 19:27
ping?msg58016 - (view) Author: Christian Heimes (christian.heimes) *
Date: 2007-11-30 22:03
I don't know how to fix the problem. You have to assign the bug to somebody who has experience with Tcl/Tk.msg58018 - (view) Author: Guido van Rossum (gvanrossum) *
Date: 2007-11-30 22:08
Can you open a separate item for the Tkinter leak so you can close this one?msg58029 - (view) Author: Christian Heimes (christian.heimes) *
Date: 2007-11-30 23:18
The bug report for test_tcl is at http://bugs.python.org/issue1532