mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Fix assertRaises usage on reflection functions which should raise
NotImplementedError on Windows XP and below.
This commit is contained in:
parent
bea424af98
commit
e9da81c62b
1 changed files with 8 additions and 5 deletions
|
@ -242,11 +242,14 @@ class LocalWinregTests(BaseWinregTests):
|
|||
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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue