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

Function test_tempdir

numpy/testing/tests/test_utils.py:1510–1524  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1508
1509
1510def test_tempdir():
1511 with tempdir() as tdir:
1512 fpath = os.path.join(tdir, 'tmp')
1513 with open(fpath, 'w'):
1514 pass
1515 assert_(not os.path.isdir(tdir))
1516
1517 raised = False
1518 try:
1519 with tempdir() as tdir:
1520 raise ValueError()
1521 except ValueError:
1522 raised = True
1523 assert_(raised)
1524 assert_(not os.path.isdir(tdir))
1525
1526
1527def test_temppath():

Callers

nothing calls this directly

Calls 4

tempdirFunction · 0.90
assert_Function · 0.90
openFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected