Skip to content

Commit ac0d4ca

Browse files
committed
Merge branch 'mr/pmderodat/tox-cov' into 'master'
Fix application of coverage configuration in the CI Closes #35 See merge request it/e3-testsuite!56
2 parents bd02722 + 5391a99 commit ac0d4ca

File tree

13 files changed

+19
-156
lines changed

13 files changed

+19
-156
lines changed

.coveragerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[report]
2+
exclude_lines =
3+
raise NotImplementedError
4+
interactive-only
5+
\.\.\.
6+
7+
[html]
8+
title = e3-testsuite coverage report

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,5 @@ ENV/
100100
# mypy
101101
.mypy_cache/
102102

103-
# Automatically generated
104-
.coveragerc
105-
106103
# Sphinx build directory
107104
doc/_build

src/e3/testsuite/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,11 @@ def testsuite_main(self, args: Optional[List[str]] = None) -> int:
444444
enable_colors = True
445445
self.main.args.show_error_output = True
446446

447-
# If explicitly requested, disable colors
448-
if self.main.args.nocolor:
447+
# If explicitly requested, disable colors.
448+
#
449+
# Do not bother having tests for this, as tests are by essence
450+
# non-interactive, and colors are never enabled for them.
451+
if self.main.args.nocolor: # interactive-only
449452
enable_colors = False
450453

451454
self.colors = ColorConfig(enable_colors)
@@ -1093,7 +1096,7 @@ def collect_result(job: Job) -> bool:
10931096
# Create a scheduler to run all fragments for the testsuite main loop
10941097

10951098
jobs = self.main.args.jobs
1096-
if self.main.args.jobs <= 0:
1099+
if self.main.args.jobs <= 0: # all: no cover
10971100
jobs = os.cpu_count() or 1
10981101

10991102
scheduler = Scheduler(

src/e3/testsuite/driver/classic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def cleanup_working_dir(self) -> None:
358358
"""Remove the working directory tree."""
359359
try:
360360
rm(self.working_dir(), True)
361-
except Exception: # no cover
361+
except Exception: # all: no cover
362362
# TODO (U222-013) For mysterious reasons, on Windows hosts,
363363
# sometimes executable files are still visible in the filesystem
364364
# even after the call to "os.unlink" returned with success. As a

src/e3/testsuite/optfileparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,5 +357,5 @@ def check_syntax_main(argv: list[str] | None = None) -> None:
357357
sys.exit(1 if has_errors else 0)
358358

359359

360-
if __name__ == "__main__": # no coverage
360+
if __name__ == "__main__": # all: no cover
361361
eval_main()

src/e3/testsuite/report/xunit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def run(self, filename: str) -> None:
232232
if kind == "pytest.xfail"
233233
else TestStatus.SKIP
234234
)
235-
else: # no cover
235+
else: # all: no cover
236236
raise AssertionError(f"invalid status tag: {tag}")
237237
if isinstance(status_elt.text, str):
238238
result.log += status_elt.text

src/e3/testsuite/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def dump_environ(filename: str, env: Env) -> None:
117117
# Also ignore variables known to be readonly on Cygwin
118118
# systems. Other users are unlikely to be affected.
119119
or var_name in ("PROFILEREAD", "SHELLOPTS")
120-
):
120+
): # all: no cover
121121
continue
122122

123123
var_value = os.environ[var_name]
@@ -128,7 +128,7 @@ def dump_environ(filename: str, env: Env) -> None:
128128
var_name == "PATH"
129129
and env.build.os.name == "windows"
130130
and os.path.pathsep in var_value
131-
):
131+
): # windows-only
132132
var_value = ":".join(
133133
unixpath(p) for p in var_value.split(os.path.pathsep)
134134
)

tests/coverage/base.rc

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/coverage/darwin.rc

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/coverage/linux.rc

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)