-
Notifications
You must be signed in to change notification settings - Fork 6
/
tox.ini
71 lines (61 loc) · 2.72 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
[tox]
envlist = py36, py37, py38
isolated_build = True
[testenv]
extras =
test
docs
passenv = DISPLAY BROWSER TOXENV
install_command = pip install {opts} {packages}
deps =
codecov>=1.4.0
coverage
whitelist_externals =
bash
test
wc
make
commands =
; Ensure ipywidgets Jupyter extension is installed
jupyter nbextension enable --py --sys-prefix widgetsnbextension
; Run unit tests and generate code coverage report
pytest --verbose --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" tests
; Ensure test Notebooks runs *without errors* (do not check for regressions yet)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=120 --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" --cov-append \
TestNotebooks/MuMoTtest.ipynb \
TestNotebooks/MiscTests/MuMoTtest_GreekLetters.ipynb \
TestNotebooks/MiscTests/MuMoTtest_MultiController.ipynb \
TestNotebooks/MiscTests/MuMoTtest_NoiseFixedPoints.ipynb \
TestNotebooks/MiscTests/MuMoTtest_oneDimensionalModels.ipynb
; Ensure the user manual Notebook runs *without errors* (do not check for regressions yet)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
pytest --verbose --maxfail=1 --nbval-lax --nbval-cell-timeout=120 docs/MuMoTuserManual.ipynb
; Additional example Notebooks (TODO; leave commented)
; TestNotebooks/MiscTests/MuMoTtest_MasterEq.ipynb - currently hangs after showNoiseEqs() for second model?
; TestNotebooks/MiscTests/MuMoTtest_bifurcation.ipynb
; TestNotebooks/MiscTests/MuMoTuserManual_for_LabPresentation.ipynb
; Ensure the user manual and regression test Notebooks do not show regressions (TODO; leave commented)
; (add --nbdime if running tox locally and want to visualise/explore diffs in web browser)
; pytest --verbose --maxfail=1 --nbval --nbval-cell-timeout=120 --cov-config=tox.ini --cov="{envsitepackagesdir}/mumot" --cov-append TestNotebooks/MuMoTtest.ipynb
; Check user manual does not contain output cells
bash -c 'test $(nbshow --outputs docs/MuMoTuserManual.ipynb | wc -c) -eq 0'
; Check we can build the docs
make --directory docs html
; Used by pytest-cov
[run]
branch = True
source = mumot
; Do not calculate coverage of third-party code.
; (NB here this is the _installed_ code in the hidden virtualenv created by tox,
; not the source code of the package)
omit =
*/site-packages/mumot/gen/*
; Used by pytest-cov
[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True