[Python-checkins] r79127 - python/trunk/Lib/test/test_thread.py

florent.xicluna python-checkins at python.org
Sat Mar 20 01:17:46 CET 2010


Author: florent.xicluna
Date: Sat Mar 20 01:17:46 2010
New Revision: 79127

Log:
#8178 Cleanup the threads after test_thread.TestForkInThread.


Modified:
   python/trunk/Lib/test/test_thread.py

Modified: python/trunk/Lib/test/test_thread.py
==============================================================================
--- python/trunk/Lib/test/test_thread.py	(original)
+++ python/trunk/Lib/test/test_thread.py	Sat Mar 20 01:17:46 2010
@@ -65,10 +65,10 @@
 
     def test_stack_size(self):
         # Various stack size tests.
-        self.assertEquals(thread.stack_size(), 0, "intial stack size is not 0")
+        self.assertEqual(thread.stack_size(), 0, "initial stack size is not 0")
 
         thread.stack_size(0)
-        self.assertEquals(thread.stack_size(), 0, "stack_size not reset to default")
+        self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
 
         if os.name not in ("nt", "os2", "posix"):
             return
@@ -88,7 +88,7 @@
             fail_msg = "stack_size(%d) failed - should succeed"
             for tss in (262144, 0x100000, 0):
                 thread.stack_size(tss)
-                self.assertEquals(thread.stack_size(), tss, fail_msg % tss)
+                self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
                 verbose_print("successfully set stack_size(%d)" % tss)
 
             for tss in (262144, 0x100000):
@@ -117,7 +117,7 @@
         thread.start_new_thread(task, ())
         while not started:
             time.sleep(0.01)
-        self.assertEquals(thread._count(), orig + 1)
+        self.assertEqual(thread._count(), orig + 1)
         # Allow the task to finish.
         mut.release()
         # The only reliable way to be sure that the thread ended from the
@@ -128,7 +128,7 @@
         del task
         while not done:
             time.sleep(0.01)
-        self.assertEquals(thread._count(), orig)
+        self.assertEqual(thread._count(), orig)
 
 
 class Barrier:
@@ -202,7 +202,8 @@
         self.read_fd, self.write_fd = os.pipe()
 
     @unittest.skipIf(sys.platform.startswith('win'),
-                    "This test is only appropriate for POSIX-like systems.")
+                     "This test is only appropriate for POSIX-like systems.")
+    @test_support.reap_threads
     def test_forkinthread(self):
         def thread1():
             try:


More information about the Python-checkins mailing list