MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_long_path_during_cleanup

Function test_long_path_during_cleanup

testing/test_pathlib.py:354–367  ·  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

352
353
354def test_long_path_during_cleanup(tmp_path: Path) -> None:
355 """Ensure that deleting long path works (particularly on Windows (#6775))."""
356 path = (tmp_path / ("a" * 250)).resolve()
357 if sys.platform == "win32":
358 # make sure that the full path is > 260 characters without any
359 # component being over 260 characters
360 assert len(str(path)) > 260
361 extended_path = "\\\\?\\" + str(path)
362 else:
363 extended_path = str(path)
364 os.mkdir(extended_path)
365 assert os.path.isdir(extended_path)
366 maybe_delete_a_numbered_dir(path)
367 assert not os.path.isdir(extended_path)
368
369
370def test_get_extended_length_path_str() -> None:

Callers

nothing calls this directly

Calls 2

mkdirMethod · 0.45

Tested by

no test coverage detected