MCPcopy Create free account
hub / github.com/numpy/numpy / test_isfileobj

Function test_isfileobj

numpy/compat/tests/test_compat.py:9–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def test_isfileobj():
10 with tempdir(prefix="numpy_test_compat_") as folder:
11 filename = join(folder, 'a.bin')
12
13 with open(filename, 'wb') as f:
14 assert_(isfileobj(f))
15
16 with open(filename, 'ab') as f:
17 assert_(isfileobj(f))
18
19 with open(filename, 'rb') as f:
20 assert_(isfileobj(f))
21
22 assert_(isfileobj(BufferedReader(BytesIO())) is False)

Callers

nothing calls this directly

Calls 5

tempdirFunction · 0.90
assert_Function · 0.90
isfileobjFunction · 0.90
joinFunction · 0.85
openFunction · 0.85

Tested by

no test coverage detected