Skip to content

Commit

Permalink
chore: Work around pytest-cov and missed lines covered in child process
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay-Lysenko committed Aug 27, 2023
1 parent cfc045f commit a748fca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dodecaphony/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def generate_new_records(
transformation_probabilities: list[float],
scoring_sets: list[str],
scoring_sets_registry: SCORING_SETS_REGISTRY_TYPE
) -> list[Record]:
) -> list[Record]: # pragma: no cover # Actually, it is covered, but `pytest-cov` misses it.
"""
Generate records for given tasks.
Expand Down
8 changes: 4 additions & 4 deletions dodecaphony/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def starmap_in_parallel(
This function contains boilerplate code that is needed for correct work
of `pytest-cov`. Usage of `mp.Pool` as context manager is not alternative
to this function, because:
1) not all covered lines of code may be marked as covered;
2) some files with names like '.coverage.hostname.*' may be not deleted.
See more: https://github.com/pytest-dev/pytest-cov/issues/250.
1) not all covered lines of code may be marked as covered
(see more: https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html);
2) some files with names like '.coverage.hostname.*' may be not deleted
(see more: https://github.com/pytest-dev/pytest-cov/issues/250).
:param fn:
function
Expand Down

0 comments on commit a748fca

Please sign in to comment.