Skip to content

Commit d81cd56

Browse files
committed
Only skip _pytest.pathlib if it is actually present
- see #669
1 parent 72940b9 commit d81cd56

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ The released versions correspond to PyPi releases.
33

44
## Unreleased
55

6+
### Fixes
7+
* only skip `_pytest.pathlib` in pytest versions where it is actually present
8+
(see [#669](../../issues/669))
9+
610
## [Version 4.5.5](https://pypi.python.org/pypi/pyfakefs/4.5.5) (2022-02-14)
711
Bugfix release, needed for compatibility with pytest 7.0.
812

pyfakefs/pytest_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def my_fakefs_test(fs):
1616

1717
Patcher.SKIPMODULES.add(py)
1818
Patcher.SKIPMODULES.add(pytest)
19-
Patcher.SKIPMODULES.add(_pytest.pathlib)
19+
if hasattr(_pytest, "pathlib"):
20+
Patcher.SKIPMODULES.add(_pytest.pathlib)
2021

2122

2223
@pytest.fixture

0 commit comments

Comments
 (0)