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

Method test_rmtree_errors_onexc

Lib/test/test_shutil.py:362–378  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

360 self.assertEqual(errors[1][2][1].filename, filename)
361
362 def test_rmtree_errors_onexc(self):
363 tmpdir = self.mkdtemp()
364 filename = os.path.join(tmpdir, "tstfile")
365 create_file(filename)
366 errors = []
367 def onexc(*args):
368 errors.append(args)
369 shutil.rmtree(filename, onexc=onexc)
370 self.assertEqual(len(errors), 2)
371 self.assertIs(errors[0][0], os.scandir)
372 self.assertEqual(errors[0][1], filename)
373 self.assertIsInstance(errors[0][2], NotADirectoryError)
374 self.assertEqual(errors[0][2].filename, filename)
375 self.assertIs(errors[1][0], os.rmdir)
376 self.assertEqual(errors[1][1], filename)
377 self.assertIsInstance(errors[1][2], NotADirectoryError)
378 self.assertEqual(errors[1][2].filename, filename)
379
380 @unittest.skipIf(sys.platform[:6] == 'cygwin',
381 "This test can't be run on Cygwin (issue #1071513).")

Callers

nothing calls this directly

Calls 6

mkdtempMethod · 0.80
assertIsInstanceMethod · 0.80
create_fileFunction · 0.70
joinMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected