Rev 2492: Run exitfuncs explicitly before exiting in http://sourcefrog.net/bzr/test-cleanup
Martin Pool
mbp at sourcefrog.net
Fri Jun 15 08:00:06 BST 2007
At http://sourcefrog.net/bzr/test-cleanup
------------------------------------------------------------
revno: 2492
revision-id: mbp at sourcefrog.net-20070615070005-zazxgg6r00wivdlm
parent: mbp at sourcefrog.net-20070519083934-uowlkzt7k007k0rg
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: test-cleanup
timestamp: Fri 2007-06-15 17:00:05 +1000
message:
Run exitfuncs explicitly before exiting
modified:
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzr'
--- a/bzr 2007-05-08 20:03:44 +0000
+++ b/bzr 2007-06-15 07:00:05 +0000
@@ -101,6 +101,10 @@
if profiling:
profile_imports.log_stack_info(sys.stderr)
+ # run anything registered by atexit, because it won't be run in the normal
+ # way
+ sys.exitfunc()
+
# By this point we really have completed everything we want to do, and
# there's no point doing any additional cleanup. Abruptly exiting here
# stops any background threads getting into trouble as code is unloaded,
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2007-05-19 08:39:34 +0000
+++ b/bzrlib/tests/__init__.py 2007-06-15 07:00:05 +0000
@@ -1857,6 +1857,7 @@
For TestCaseInTempDir we create a temporary directory based on the test
name and then create two subdirs - test and home under it.
"""
+ # create a directory within the top level test directory
candidate_dir = tempfile.mkdtemp(dir=self.TEST_ROOT)
# now create test and home directories within this dir
self.test_base_dir = candidate_dir
More information about the bazaar-commits
mailing list