Commit 07e12f4
committed
Remove usage of
`py.path` provides classes for representing filesystem paths, but became
obsolete when `pathlib` was added to Python standard library. `pytest`
recommends creating temporary directories with the `tmp_path` fixture,
which uses `pathlib`, instead of the older `tmpdir` fixture, which uses
`py.path`. Furthermore, it is suggested to call `pytest` with
`-p no:legacypath` to remove support for `py.path` entirely, which helps
ensure `tmpdir` is not used at all. However, this also breaks any code
accessing `_pytest.nodes.Node.fspath`. Because `pytest-mpl` includes
such code then packages using it cannot turn off `py.path` support to
guard against `tmpdir` usage. Although replacing accessing `fspath` in
older versions of `pytest` is complicated, it is very simple since
`pytest` 7, so now at least the packages using recent versions of
`pytest` can choose to make use of the `-p no:legacypath` option.py.path with pytest 71 parent 95c440b commit 07e12f4
1 file changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
445 | 450 | | |
446 | 451 | | |
447 | 452 | | |
448 | | - | |
| 453 | + | |
449 | 454 | | |
450 | 455 | | |
451 | 456 | | |
452 | | - | |
| 457 | + | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
459 | 464 | | |
460 | | - | |
| 465 | + | |
461 | 466 | | |
462 | 467 | | |
463 | 468 | | |
| |||
686 | 691 | | |
687 | 692 | | |
688 | 693 | | |
689 | | - | |
| 694 | + | |
690 | 695 | | |
691 | 696 | | |
692 | 697 | | |
| |||
0 commit comments