Commit 3864526
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` accesses
that 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 3864526
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
445 | 454 | | |
446 | 455 | | |
447 | 456 | | |
448 | | - | |
| 457 | + | |
449 | 458 | | |
450 | 459 | | |
451 | 460 | | |
452 | | - | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
458 | 467 | | |
459 | 468 | | |
460 | | - | |
| 469 | + | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
| |||
686 | 695 | | |
687 | 696 | | |
688 | 697 | | |
689 | | - | |
| 698 | + | |
690 | 699 | | |
691 | 700 | | |
692 | 701 | | |
| |||
0 commit comments