Skip to content

Commit 030c1db

Browse files
committed
put in a fix for missing .coveragerc
1 parent 1e389e0 commit 030c1db

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

testflo/cover.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ def setup_coverage(options):
2828
data_file = os.path.join(cover_dir, '.coverage')
2929
cfg_file = os.path.join(cover_dir, '.coveragerc')
3030

31-
cov = coverage.Coverage(
32-
config_file=cfg_file,
33-
data_file=data_file,
34-
data_suffix=True,
35-
branch=options.cover_branch,
36-
)
31+
kwargs = {
32+
'data_file': data_file,
33+
'data_suffix': True,
34+
'branch': options.cover_branch,
35+
}
36+
37+
if os.path.isfile(cfg_file):
38+
kwargs['config_file'] = cfg_file
39+
40+
cov = coverage.Coverage(**kwargs)
3741

3842
cov.config.ignore_errors = True
3943

0 commit comments

Comments
 (0)