MCPcopy
hub / github.com/pytest-dev/pytest / test_long_path_during_cleanup

Function test_long_path_during_cleanup

testing/test_pathlib.py:473–486  ·  view source on GitHub ↗

Ensure that deleting long path works (particularly on Windows (#6775)).

(tmp_path: Path)

Source from the content-addressed store, hash-verified

471
472
473def test_long_path_during_cleanup(tmp_path: Path) -> None:
474 """Ensure that deleting long path works (particularly on Windows (#6775))."""
475 path = (tmp_path / ("a" * 250)).resolve()
476 if sys.platform == "win32":
477 # make sure that the full path is > 260 characters without any
478 # component being over 260 characters
479 assert len(str(path)) > 260
480 extended_path = "\\\\?\\" + str(path)
481 else:
482 extended_path = str(path)
483 os.mkdir(extended_path)
484 assert os.path.isdir(extended_path)
485 maybe_delete_a_numbered_dir(path)
486 assert not os.path.isdir(extended_path)
487
488
489def test_get_extended_length_path_str() -> None:

Callers

nothing calls this directly

Calls 3

mkdirMethod · 0.45
isdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…