()
| 1508 | |
| 1509 | |
| 1510 | def 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 | |
| 1527 | def test_temppath(): |