Ensure that deleting long path works (particularly on Windows (#6775)).
(tmp_path: Path)
| 352 | |
| 353 | |
| 354 | def 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 | |
| 370 | def test_get_extended_length_path_str() -> None: |
nothing calls this directly
no test coverage detected