Integration test for #5524
(pytester: Pytester)
| 408 | |
| 409 | |
| 410 | def test_basetemp_with_read_only_files(pytester: Pytester) -> None: |
| 411 | """Integration test for #5524""" |
| 412 | pytester.makepyfile( |
| 413 | """ |
| 414 | import os |
| 415 | import stat |
| 416 | |
| 417 | def test(tmp_path): |
| 418 | fn = tmp_path / 'foo.txt' |
| 419 | fn.write_text('hello') |
| 420 | mode = os.stat(str(fn)).st_mode |
| 421 | os.chmod(str(fn), mode & ~stat.S_IREAD) |
| 422 | """ |
| 423 | ) |
| 424 | result = pytester.runpytest("--basetemp=tmp") |
| 425 | assert result.ret == 0 |
| 426 | # running a second time and ensure we don't crash |
| 427 | result = pytester.runpytest("--basetemp=tmp") |
| 428 | assert result.ret == 0 |
| 429 | |
| 430 | |
| 431 | def test_tmp_path_factory_handles_invalid_dir_characters( |
nothing calls this directly
no test coverage detected