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

Function test_errorfix_explicit

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

Source from the content-addressed store, hash-verified

37
38
39def test_errorfix_explicit():
40 @library.python.windows.errorfix
41 def erroneous_func():
42 if library.python.windows.on_win():
43 err = WindowsError()
44 err.winerror = library.python.windows.ERRORS['ACCESS_DENIED']
45 else:
46 err = OSError()
47 err.errno = errno.EACCES
48 err.strerror = 'Some error description'
49 err.filename = 'unknown/file'
50 raise err
51
52 with pytest.raises(OSError) as errinfo:
53 erroneous_func()
54 assert errinfo.value.errno == errno.EACCES
55 assert errinfo.value.filename == 'unknown/file'
56 assert errinfo.value.strerror == 'Some error description'
57
58
59def test_errorfix_decoding_cp1251():

Callers

nothing calls this directly

Calls 1

erroneous_funcFunction · 0.70

Tested by

no test coverage detected