MCPcopy Create free account
hub / github.com/catboost/catboost / test_diehard

Function test_diehard

library/python/windows/ut/test_windows.py:79–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77
78
79def test_diehard():
80 @library.python.windows.diehard(library.python.windows.ERRORS['ACCESS_DENIED'], tries=5)
81 def erroneous_func(errors):
82 try:
83 gen_error_access_denied()
84 except Exception as e:
85 errors.append(e)
86 raise
87
88 raised_errors = []
89 with pytest.raises(OSError) as errinfo:
90 erroneous_func(raised_errors)
91 assert errinfo.value.errno == errno.EACCES
92 assert any(e.errno == errno.EACCES for e in raised_errors)
93 assert raised_errors and errinfo.value == raised_errors[-1]
94 if library.python.windows.on_win():
95 assert len(raised_errors) == 5
96 else:
97 assert len(raised_errors) == 1

Callers

nothing calls this directly

Calls 3

anyFunction · 0.85
lenFunction · 0.85
erroneous_funcFunction · 0.70

Tested by

no test coverage detected