MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_unreadable_dir_on_syspath

Method test_unreadable_dir_on_syspath

Lib/test/test_pkgutil.py:138–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136 list(pkgutil.iter_modules("invalid_path"))
137
138 def test_unreadable_dir_on_syspath(self):
139 # issue7367 - walk_packages failed if unreadable dir on sys.path
140 package_name = "unreadable_package"
141 d = os.path.join(self.dirname, package_name)
142 # this does not appear to create an unreadable dir on Windows
143 # but the test should not fail anyway
144 os.mkdir(d, 0)
145 self.addCleanup(os.rmdir, d)
146 for t in pkgutil.walk_packages(path=[self.dirname]):
147 self.fail("unexpected package found")
148
149 def test_walkpackages_filesys(self):
150 pkg1 = 'test_walkpackages_filesys'

Callers

nothing calls this directly

Calls 4

addCleanupMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected