File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 15
15
import hashlib
16
16
import warnings
17
17
from collections import OrderedDict , defaultdict
18
+ from pathlib import Path
18
19
19
20
from queue import Empty
20
21
@@ -141,7 +142,10 @@ def pytest_collect_file(path, parent):
141
142
if (opt .nbval or opt .nbval_lax ) and path .fnmatch ("*.ipynb" ):
142
143
# https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent
143
144
if hasattr (IPyNbFile , "from_parent" ):
144
- return IPyNbFile .from_parent (parent , fspath = path )
145
+ try : # Pytest >= 7.0.0
146
+ return IPyNbFile .from_parent (parent , path = Path (path ))
147
+ except AssertionError :
148
+ return IPyNbFile .from_parent (parent , fspath = path )
145
149
else : # Pytest < 5.4
146
150
return IPyNbFile (path , parent )
147
151
You can’t perform that action at this time.
0 commit comments