MCPcopy Index your code
hub / github.com/python/cpython / test_winreg

Function test_winreg

Lib/test/audit-tests.py:377–397  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375
376
377def test_winreg():
378 from winreg import OpenKey, EnumKey, CloseKey, HKEY_LOCAL_MACHINE
379
380 def hook(event, args):
381 if not event.startswith("winreg."):
382 return
383 print(event, *args)
384
385 sys.addaudithook(hook)
386
387 k = OpenKey(HKEY_LOCAL_MACHINE, "Software")
388 EnumKey(k, 0)
389 try:
390 EnumKey(k, 10000)
391 except OSError:
392 pass
393 else:
394 raise RuntimeError("Expected EnumKey(HKLM, 10000) to fail")
395
396 kv = k.Detach()
397 CloseKey(kv)
398
399
400def test_socket():

Callers

nothing calls this directly

Calls 1

DetachMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…