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

Method test_addsitedir_hidden_flags

Lib/test/test_site.py:214–225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212
213 @unittest.skipUnless(hasattr(os, 'chflags'), 'test needs os.chflags()')
214 def test_addsitedir_hidden_flags(self):
215 pth_file = PthFile()
216 pth_file.cleanup(prep=True)
217 try:
218 pth_file.create()
219 st = os.stat(pth_file.file_path)
220 os.chflags(pth_file.file_path, st.st_flags | stat.UF_HIDDEN)
221 site.addsitedir(pth_file.base_dir, set())
222 self.assertNotIn(site.makepath(pth_file.good_dir_path)[0], sys.path)
223 self.assertIn(pth_file.base_dir, sys.path)
224 finally:
225 pth_file.cleanup()
226
227 @unittest.skipUnless(sys.platform == 'win32', 'test needs Windows')
228 @support.requires_subprocess()

Callers

nothing calls this directly

Calls 7

cleanupMethod · 0.95
createMethod · 0.95
PthFileClass · 0.85
setFunction · 0.85
assertNotInMethod · 0.80
assertInMethod · 0.80
statMethod · 0.45

Tested by

no test coverage detected