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