Skip to content

Commit

Permalink
test_coverage.py: fix formatting
Browse files Browse the repository at this point in the history
CI is failing since `black` suggests some reformatting.
Let's apply them.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
  • Loading branch information
stefano-garzarella authored and roypat committed Oct 20, 2023
1 parent 352bc23 commit b6483eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions integration_tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def _get_current_coverage(coverage_config, no_cleanup, test_scope):
# on a clean environment.
shutil.rmtree(cov_build_dir, ignore_errors=True)

llvm_cov_command = f"CARGO_TARGET_DIR={cov_build_dir} cargo llvm-cov test --summary-only"
llvm_cov_command = (
f"CARGO_TARGET_DIR={cov_build_dir} cargo llvm-cov test --summary-only"
)

additional_exclude_path = coverage_config["exclude_path"]
if additional_exclude_path:
Expand All @@ -91,9 +93,11 @@ def _get_current_coverage(coverage_config, no_cleanup, test_scope):

# Pytest closes stdin by default, but some tests might need it to be open.
# In the future, should the need arise, we can feed custom data to stdin.
result = subprocess.run(llvm_cov_command, shell=True, check=True, input=b"", stdout=subprocess.PIPE)
result = subprocess.run(
llvm_cov_command, shell=True, check=True, input=b"", stdout=subprocess.PIPE
)

summary = result.stdout.split(b'\n')[-2]
summary = result.stdout.split(b"\n")[-2]
# Output of llvm-cov is like
# TOTAL 743 153 79.41% 185 50 72.97% 1531 125 91.84% 0 0 -
# where the first three numbers are related to region coverage, and next three to line coverage (what we want)
Expand Down

0 comments on commit b6483eb

Please sign in to comment.