[Python-checkins] r79640 - python/trunk/Lib/test/test_winreg.py

brian.curtin python-checkins at python.org
Sat Apr 3 02:59:32 CEST 2010


Author: brian.curtin
Date: Sat Apr  3 02:59:32 2010
New Revision: 79640

Log:
Fix assertRaises usage on reflection functions which should raise
NotImplementedError on Windows XP and below.


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

Modified: python/trunk/Lib/test/test_winreg.py
==============================================================================
--- python/trunk/Lib/test/test_winreg.py	(original)
+++ python/trunk/Lib/test/test_winreg.py	Sat Apr  3 02:59:32 2010
@@ -242,11 +242,14 @@
             key = OpenKey(HKEY_CURRENT_USER, test_key_name)
             self.assertNotEqual(key.handle, 0)
 
-            self.assertRaises(NotImplementedError, DisableReflectionKey(key))
-            self.assertRaises(NotImplementedError, EnableReflectionKey(key))
-            self.assertRaises(NotImplementedError, QueryReflectionKey(key))
-            self.assertRaises(NotImplementedError,
-                              DeleteKeyEx(HKEY_CURRENT_USER, test_key_name))
+            with self.assertRaises(NotImplementedError):
+                DisableReflectionKey(key)
+            with self.assertRaises(NotImplementedError):
+                EnableReflectionKey(key)
+            with self.assertRaises(NotImplementedError):
+                QueryReflectionKey(key)
+            with self.assertRaises(NotImplementedError):
+                DeleteKeyEx(HKEY_CURRENT_USER, test_key_name)
         finally:
             DeleteKey(HKEY_CURRENT_USER, test_key_name)
 


More information about the Python-checkins mailing list