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

Function test_long_path_during_cleanup

testing/test_pathlib.py:473–486  ·  testing/test_pathlib.py::test_long_path_during_cleanup

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 class="st">""class="st">"Ensure that deleting long path works (particularly on Windows (class="cm">#6775))."class="st">""
475 path = (tmp_path / (class="st">"a" * 250)).resolve()
476 if sys.platform == class="st">"win32":
477 class="cm"># make sure that the full path is > 260 characters without any
478 class="cm"># component being over 260 characters
479 assert len(str(path)) > 260
480 extended_path = class="st">"\\\\?\\" + 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