Skip to content

Commit 07b9001

Browse files
authored
Merge pull request #94 from computationalmodelling/cov-config-abs
Pass coverage config file by absolute path
2 parents 13ba300 + 37af2a6 commit 07b9001

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ __pycache__
55
**/build/
66
*.egg-info
77
.cache
8+
.pytest_cache
89
.doit.db*
10+
.coverage*

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ install:
1414
# Ensure python scripts are from right version:
1515
- 'SET "PATH=%PYTHON%\Scripts;%PYTHON%;%PATH%"'
1616
# Update pip/setuptools:
17-
- pip install --upgrade setuptools pip
17+
- python -m pip install --upgrade setuptools pip
1818
# Install our package:
1919
- pip install .
2020
- pip install doit

nbval/cover.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def setup_coverage(config, kernel, floc, output_loc=None):
5151
# Get options from pytest-cov's command line arguments:
5252
source = config.option.cov_source
5353
config_file = config.option.cov_config
54+
if isinstance(config_file, str) and os.path.isfile(config_file):
55+
config_file = os.path.abspath(config_file)
5456

5557
# Copy the suffix of plugin if available
5658
suffix = _make_suffix(cov)

tests/sample_notebook.ipynb

Lines changed: 25 additions & 27 deletions
Large diffs are not rendered by default.

tests/test_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_sum():
3737
"lib.myprod(1, 3)",
3838
"lib.myprod(2.5, 2.5)",
3939
"lib.myprod(2, 'cat')"
40-
])
40+
], mark_run=True)
4141
add_expected_plaintext_outputs(nb, [
4242
None, "3", "6.25", "'catcat'"
4343
])

0 commit comments

Comments
 (0)