File tree Expand file tree Collapse file tree 2 files changed +265
-75
lines changed Expand file tree Collapse file tree 2 files changed +265
-75
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -161,13 +161,20 @@ def clean(ctx: Context):
161
161
"parallel" : "Run the notebooks in parallel." ,
162
162
"overwrite" : "Overwrite the notebooks with the executed output." ,
163
163
"pattern" : "Run only the notebooks that match the pattern. Same as `pytest -k`" ,
164
+ "fast" : (
165
+ "Run the notebooks in fast mode by setting the environment variable "
166
+ "`NB_FAST` to `true`. You cannot use this option with `--overwrite`."
167
+ ),
168
+ "no_skip" : "Do not skip any notebooks." ,
164
169
}
165
170
)
166
171
def test_notebooks (
167
172
ctx : Context ,
168
173
parallel : bool = True ,
169
174
overwrite : bool = False ,
170
175
pattern : Optional [str ] = None ,
176
+ fast : bool = True ,
177
+ no_skip : bool = False ,
171
178
):
172
179
"""Run the notebooks and check for errors.
173
180
@@ -176,9 +183,14 @@ def test_notebooks(
176
183
with the executed output.
177
184
178
185
"""
186
+ assert not (fast and overwrite ), "You cannot use `--overwrite` with `--fast`."
187
+
188
+ # Set the environment variable to run the notebooks in fast mode.
189
+ if fast :
190
+ environ ["NB_FAST" ] = "true"
179
191
180
192
skip_notebooks = ctx ["test_skip_notebooks" ]
181
- if skip_notebooks is None :
193
+ if skip_notebooks is None or no_skip :
182
194
skip_notebooks = []
183
195
print (f"Skipping notebooks: { skip_notebooks } " )
184
196
cmd = [
You can’t perform that action at this time.
0 commit comments