MCPcopy Create free account
hub / github.com/celery/celery / test_fd_by_path

Function test_fd_by_path

t/unit/utils/test_platforms.py:49–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48@t.skip.if_win32
49def test_fd_by_path():
50 test_file = tempfile.NamedTemporaryFile()
51 try:
52 keep = fd_by_path([test_file.name])
53 assert keep == [test_file.file.fileno()]
54 with patch('os.open') as _open:
55 _open.side_effect = OSError()
56 assert not fd_by_path([test_file.name])
57 finally:
58 test_file.close()
59
60
61@t.skip.if_win32

Callers

nothing calls this directly

Calls 3

fd_by_pathFunction · 0.90
filenoMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected