[Python-checkins] r80564 - python/trunk/Lib/test/test_hashlib.py

victor.stinner python-checkins at python.org
Wed Apr 28 00:59:35 CEST 2010


Author: victor.stinner
Date: Wed Apr 28 00:59:35 2010
New Revision: 80564

Log:
Issue #7449, part 6: fix test_hashlib for missing threading module

Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().


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

Modified: python/trunk/Lib/test/test_hashlib.py
==============================================================================
--- python/trunk/Lib/test/test_hashlib.py	(original)
+++ python/trunk/Lib/test/test_hashlib.py	Wed Apr 28 00:59:35 2010
@@ -299,10 +299,9 @@
           "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
           "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")
 
+    @unittest.skipUnless(threading, 'Threading required for this test.')
+    @test_support.reap_threads
     def test_threaded_hashing(self):
-        if not threading:
-            raise unittest.SkipTest('No threading module.')
-
         # Updating the same hash object from several threads at once
         # using data chunk sizes containing the same byte sequences.
         #
@@ -337,7 +336,6 @@
 
         self.assertEqual(expected_hash, hasher.hexdigest())
 
- at test_support.reap_threads
 def test_main():
     test_support.run_unittest(HashLibTestCase)
 


More information about the Python-checkins mailing list