File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -134,21 +134,14 @@ def pytest_configure(config):
134
134
135
135
136
136
137
- def pytest_collect_file (path , parent ):
137
+ def pytest_collect_file (collection_path , parent ):
138
138
"""
139
139
Collect IPython notebooks using the specified pytest hook
140
140
"""
141
141
opt = parent .config .option
142
- if (opt .nbval or opt .nbval_lax ) and path . fnmatch ( "* .ipynb") :
142
+ if (opt .nbval or opt .nbval_lax ) and collection_path . suffix == " .ipynb" :
143
143
# https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent
144
- if hasattr (IPyNbFile , "from_parent" ):
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 )
149
- else : # Pytest < 5.4
150
- return IPyNbFile (path , parent )
151
-
144
+ return IPyNbFile .from_parent (parent , path = collection_path )
152
145
153
146
154
147
comment_markers = {
Original file line number Diff line number Diff line change 21
21
]
22
22
},
23
23
install_requires = [
24
- 'pytest >= 2.8 ' ,
24
+ 'pytest >= 7 ' ,
25
25
'jupyter_client' ,
26
26
'nbformat' ,
27
27
'ipykernel' ,
You can’t perform that action at this time.
0 commit comments