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

Method test_pathext

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

Source from the content-addressed store, hash-verified

2520
2521 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2522 def test_pathext(self):
2523 ext = '.xyz'
2524 cmd = self.to_text_type(TESTFN2)
2525 cmdext = cmd + self.to_text_type(ext)
2526 filepath = os.path.join(self.dir, cmdext)
2527 self.create_file(filepath)
2528 with os_helper.EnvironmentVarGuard() as env:
2529 env['PATHEXT'] = ext
2530 self.assertEqual(shutil.which(cmd, path=self.dir), filepath)
2531 self.assertEqual(shutil.which(cmdext, path=self.dir), filepath)
2532
2533 # Issue 40592: See https://bugs.python.org/issue40592
2534 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')

Callers

nothing calls this directly

Calls 3

create_fileMethod · 0.95
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected