Skip to content

Commit 033e857

Browse files
committed
Pass coverage config file by absolute path
The kernel may not be running in the same working directory as the test process.
1 parent 13ba300 commit 033e857

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ __pycache__
66
*.egg-info
77
.cache
88
.doit.db*
9+
.coverage*

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 config_file and isinstance(config_file, str):
55+
config_file = os.path.abspath(config_file)
5456

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

0 commit comments

Comments
 (0)