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 1515import hashlib
1616import warnings
1717from collections import OrderedDict , defaultdict
18+ from pathlib import Path
1819
1920from queue import Empty
2021
@@ -141,7 +142,10 @@ def pytest_collect_file(path, parent):
141142 if (opt .nbval or opt .nbval_lax ) and path .fnmatch ("*.ipynb" ):
142143 # https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent
143144 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 )
145149 else : # Pytest < 5.4
146150 return IPyNbFile (path , parent )
147151
You can’t perform that action at this time.
0 commit comments