MCPcopy Create free account
hub / github.com/python/cpython / test_listdir_scandir

Method test_listdir_scandir

Lib/test/test_os/test_posix.py:2446–2458  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2444
2445
2446 def test_listdir_scandir(self):
2447 self._verify_available("HAVE_FDOPENDIR")
2448 if self.mac_ver >= (10, 10):
2449 self.assertIn("HAVE_FDOPENDIR", posix._have_functions)
2450
2451 else:
2452 self.assertNotIn("HAVE_FDOPENDIR", posix._have_functions)
2453
2454 with self.assertRaisesRegex(TypeError, "listdir: path should be string, bytes, os.PathLike or None, not int"):
2455 os.listdir(0)
2456
2457 with self.assertRaisesRegex(TypeError, "scandir: path should be string, bytes, os.PathLike or None, not int"):
2458 os.scandir(0)
2459
2460 def test_mkdir(self):
2461 self._verify_available("HAVE_MKDIRAT")

Callers

nothing calls this directly

Calls 6

_verify_availableMethod · 0.95
assertInMethod · 0.80
assertNotInMethod · 0.80
assertRaisesRegexMethod · 0.80
listdirMethod · 0.80
scandirMethod · 0.45

Tested by

no test coverage detected