()
| 37 | |
| 38 | |
| 39 | def 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 | |
| 59 | def test_errorfix_decoding_cp1251(): |
nothing calls this directly
no test coverage detected