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

Method test_wmi_query_error

Lib/test/test_wmi.py:43–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41 self.test_wmi_query_os_version()
42
43 def test_wmi_query_error(self):
44 # Invalid queries fail with OSError
45 try:
46 wmi_exec_query("SELECT InvalidColumnName FROM InvalidTableName")
47 except OSError as ex:
48 if ex.winerror & 0xFFFFFFFF == 0x80041010:
49 # This is the expected error code. All others should fail the test
50 return
51 self.fail("Expected OSError")
52
53 def test_wmi_query_repeated_error(self):
54 for _ in range(10):

Callers 1

Calls 2

wmi_exec_queryFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected