[Zodb-checkins] CVS: ZODB3/ZEO/tests - testStart.py:1.12.8.3

Guido van Rossum guido@python.org
Mon, 27 Jan 2003 14:12:51 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv19858

Modified Files:
      Tag: ZODB3-3_1-branch
	testStart.py 
Log Message:
Make sure this test doesn't leave temp files behind.


=== ZODB3/ZEO/tests/testStart.py 1.12.8.2 => 1.12.8.3 ===
--- ZODB3/ZEO/tests/testStart.py:1.12.8.2	Fri Jan  3 10:04:15 2003
+++ ZODB3/ZEO/tests/testStart.py	Mon Jan 27 14:12:48 2003
@@ -134,6 +134,7 @@
         f = open(file, "rb")
         buf = f.read()
         f.close()
+        os.unlink(file)
         return buf
 
     def connect(self, port=None, wait=1):
@@ -153,6 +154,7 @@
         port = 9090
         logfile1 = tempfile.mktemp(suffix="log")
         logfile2 = tempfile.mktemp(suffix="log")
+        print "\nlogfiles:", logfile1, logfile2
         os.environ["STUPID_LOG_FILE"] = logfile1
         os.environ["EVENT_LOG_FILE"] = logfile1
 
@@ -177,6 +179,10 @@
             self.assert_(buf2)
         finally:
             self.shutdown()
+            os.environ["STUPID_LOG_FILE"] = "/dev/null"
+            os.environ["EVENT_LOG_FILE"] = "/dev/null"
+            del os.environ["STUPID_LOG_FILE"]
+            del os.environ["EVENT_LOG_FILE"]
             try:
                 os.unlink(logfile1)
             except os.error: