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 4646 REDIS_HOST : localhost
4747 REDIS_PORT : 6379
4848 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
1818hiredis == 1.0.0
1919idna == 3.3
2020importlib-resources == 5.4.0
21+ iniconfig == 1.1.1
2122ipykernel == 6.5.1
2223ipython == 7.29.0
2324ipython-genutils == 0.2.0
@@ -54,14 +55,17 @@ pathspec==0.9.0
5455pexpect == 4.8.0
5556pickleshare == 0.7.5
5657platformdirs == 2.4.0
58+ pluggy == 1.0.0
5759prometheus-client == 0.12.0
5860prompt-toolkit == 3.0.22
5961protobuf == 3.19.1
6062ptyprocess == 0.7.0
63+ py == 1.11.0
6164pycparser == 2.21
6265Pygments == 2.10.0
6366pyparsing == 3.0.6
6467pyrsistent == 0.18.0
68+ pytest == 6.2.5
6569python-dateutil == 2.8.2
6670pytz == 2021.3
6771PyYAML == 6.0
@@ -82,6 +86,7 @@ terminado==0.12.1
8286testpath == 0.5.0
8387textwrap3 == 0.9.2
8488threadpoolctl == 3.0.0
89+ toml == 0.10.2
8590tomli == 1.2.2
8691tornado == 6.1
8792tqdm == 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