MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_context_manager

Method test_context_manager

Lib/test/test_winreg.py:254–261  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

252 self.assertEqual(r, os.environ["windir"] + "\\test")
253
254 def test_context_manager(self):
255 # ensure that the handle is closed if an exception occurs
256 try:
257 with ConnectRegistry(None, HKEY_LOCAL_MACHINE) as h:
258 self.assertNotEqual(h.handle, 0)
259 raise OSError
260 except OSError:
261 self.assertEqual(h.handle, 0)
262
263 def test_changing_value(self):
264 # Issue2810: A race condition in 2.6 and 3.1 may cause

Callers

nothing calls this directly

Calls 3

ConnectRegistryFunction · 0.85
assertNotEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected