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

Method _check_path_limitations

Lib/test/test_reprlib.py:691–710  ·  view source on GitHub ↗
(self, module_name)

Source from the content-addressed store, hash-verified

689 del sys.path[0]
690
691 def _check_path_limitations(self, module_name):
692 # base directory
693 source_path_len = len(self.here)
694 # a path separator + `longname` (twice)
695 source_path_len += 2 * (len(self.longname) + 1)
696 # a path separator + `module_name` + ".py"
697 source_path_len += len(module_name) + 1 + len(".py")
698 try:
699 cached_path_len = (source_path_len +
700 len(importlib.util.cache_from_source("x.py")) - len("x.py"))
701 except NotImplementedError:
702 cached_path_len = source_path_len
703 if os.name == 'nt' and cached_path_len >= 258:
704 # Under Windows, the max path len is 260 including C's terminating
705 # NUL character.
706 # (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath)
707 self.skipTest("test paths too long (%d characters) for Windows' 260 character limit"
708 % cached_path_len)
709 elif os.name == 'nt' and verbose:
710 print("cached_path_len =", cached_path_len)
711
712 def test_module(self):
713 self.maxDiff = None

Callers 5

test_moduleMethod · 0.95
test_typeMethod · 0.95
test_classMethod · 0.95
test_instanceMethod · 0.95
test_methodMethod · 0.95

Calls 1

skipTestMethod · 0.80

Tested by

no test coverage detected