Skip to content

Commit 2451c78

Browse files
Add contexts to coverage report
1 parent 22ffcba commit 2451c78

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.coveragerc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source = src/
44
branch = True
55
relative_files = True
6+
dynamic_context = test_function
67
omit =
78
# omit anything in a .local directory anywhere
89
*/.local/*
@@ -12,13 +13,15 @@ omit =
1213
./utest/*
1314
# robot library
1415
./src/robotide/lib/robot/*
16+
./src/robotide/preferences/configobj/*
1517
*/.venv/*
1618

1719
[report]
1820
skip_empty = True
1921
exclude_lines =
2022
if __name__ == '__main__':
21-
23+
if __name__ == '__main__' and 'robotide' not in sys.modules:
24+
2225
[xml]
2326
output = .coverage-reports/coverage.xml
2427

tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ def test_ci(ctx, test_filter=''):
414414
a.communicate(b'')
415415
b = subprocess.Popen(["coverage", "run", "-a", "--data-file=.coverage.2", "-m", "pytest", "--ignore=utest/application/test_app_main.py", "--cov-config=.coveragerc", "-k test_", "-v", TEST_DIR])
416416
b.communicate(b'')
417-
c = subprocess.Popen(["coverage", "combine"])
417+
c = subprocess.Popen(["coverage", "combine"]) #, "--keep"
418418
c.communicate(b'')
419419
r = subprocess.Popen(["coverage", "report"])
420420
r.communicate(b'')
421421
x = subprocess.Popen(["coverage", "xml"])
422422
x.communicate(b'')
423-
h = subprocess.Popen(["coverage", "html"])
423+
h = subprocess.Popen(["coverage", "html", "--contexts=.*", "--show-contexts"])
424424
h.communicate(b'')
425425
finally:
426426
""" Nothing to do """

0 commit comments

Comments
 (0)