MCPcopy Index your code
hub / github.com/python/cpython / test_explicit_cleanup

Method test_explicit_cleanup

Lib/test/test_tempfile.py:1669–1680  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1667 self.assertEqual(cm.exception.errno, errno.ENOENT)
1668
1669 def test_explicit_cleanup(self):
1670 # A TemporaryDirectory is deleted when cleaned up
1671 dir = tempfile.mkdtemp()
1672 try:
1673 d = self.do_create(dir=dir)
1674 self.assertTrue(os.path.exists(d.name),
1675 "TemporaryDirectory %s does not exist" % d.name)
1676 d.cleanup()
1677 self.assertFalse(os.path.exists(d.name),
1678 "TemporaryDirectory %s exists after cleanup" % d.name)
1679 finally:
1680 os.rmdir(dir)
1681
1682 def test_explicit_cleanup_ignore_errors(self):
1683 """Test that cleanup doesn't return an error when ignoring them."""

Callers

nothing calls this directly

Calls 7

do_createMethod · 0.95
mkdtempMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
rmdirMethod · 0.80
existsMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected