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

Method test_unpickable

Lib/test/test_os/test_os.py:4772–4778  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4770 self.assertRaises(TypeError, os.DirEntry)
4771
4772 def test_unpickable(self):
4773 filename = create_file(os.path.join(self.path, "file.txt"), b'python')
4774 entry = [entry for entry in os.scandir(self.path)].pop()
4775 self.assertIsInstance(entry, os.DirEntry)
4776 self.assertEqual(entry.name, "file.txt")
4777 import pickle
4778 self.assertRaises(TypeError, pickle.dumps, entry, filename)
4779
4780
4781class TestScandir(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

assertIsInstanceMethod · 0.80
create_fileFunction · 0.70
joinMethod · 0.45
popMethod · 0.45
scandirMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected