File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 46
46
REDIS_HOST : localhost
47
47
REDIS_PORT : 6379
48
48
run : |
49
- papermill scikit_learn/ScikitLearn2Production.ipynb -
49
+ pytest test.py
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ entrypoints==0.3
18
18
hiredis == 1.0.0
19
19
idna == 3.3
20
20
importlib-resources == 5.4.0
21
+ iniconfig == 1.1.1
21
22
ipykernel == 6.5.1
22
23
ipython == 7.29.0
23
24
ipython-genutils == 0.2.0
@@ -54,14 +55,17 @@ pathspec==0.9.0
54
55
pexpect == 4.8.0
55
56
pickleshare == 0.7.5
56
57
platformdirs == 2.4.0
58
+ pluggy == 1.0.0
57
59
prometheus-client == 0.12.0
58
60
prompt-toolkit == 3.0.22
59
61
protobuf == 3.19.1
60
62
ptyprocess == 0.7.0
63
+ py == 1.11.0
61
64
pycparser == 2.21
62
65
Pygments == 2.10.0
63
66
pyparsing == 3.0.6
64
67
pyrsistent == 0.18.0
68
+ pytest == 6.2.5
65
69
python-dateutil == 2.8.2
66
70
pytz == 2021.3
67
71
PyYAML == 6.0
@@ -82,6 +86,7 @@ terminado==0.12.1
82
86
testpath == 0.5.0
83
87
textwrap3 == 0.9.2
84
88
threadpoolctl == 3.0.0
89
+ toml == 0.10.2
85
90
tomli == 1.2.2
86
91
tornado == 6.1
87
92
tqdm == 4.62.3
Original file line number Diff line number Diff line change
1
+ import papermill as pm
2
+ import os
3
+ import glob
4
+ import pytest
5
+
6
+
7
+ def notebook_runner (notebook_path ):
8
+ """
9
+ This pytest function runs all the ipynb files in the repository
10
+ using papermill - a notebook runner that throws if any exception occurs while executing the notebook
11
+ """
12
+ # Run all the notebooks in the repository
13
+ pm .execute_notebook (notebook_path , "-" )
14
+
15
+
16
+
17
+ parameterizer = pytest .mark .parametrize ("notebook_path" , glob .glob (os .path .join (os .path .dirname (__file__ ), "*.ipynb" )))
18
+ # this variable (Which is a function) will be executed when pytest triggers the test
19
+ test_notebooks = parameterizer (notebook_runner )
You can’t perform that action at this time.
0 commit comments