Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .evergreen/scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import logging
import os
import platform
import shlex
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -205,13 +204,11 @@ def run() -> None:
TEST_ARGS.extend(f"-o log_cli_level={logging.DEBUG}".split())

if os.environ.get("COVERAGE"):
binary = sys.executable.replace(os.sep, "/")
cmd = f"{binary} -m coverage run -m pytest {' '.join(TEST_ARGS)} {' '.join(sys.argv[1:])}"
result = subprocess.run(shlex.split(cmd), check=False) # noqa: S603
cmd = f"{binary} -m coverage report"
subprocess.run(shlex.split(cmd), check=False) # noqa: S603
if result.returncode != 0:
print(result.stderr)
# Pass the args as a list to preserve multi-word entries like the
# marker expression added by handle_green_framework().
cmd = [sys.executable, "-m", "coverage", "run", "-m", "pytest", *TEST_ARGS, *sys.argv[1:]]
result = subprocess.run(cmd, check=False) # noqa: S603
subprocess.run([sys.executable, "-m", "coverage", "report"], check=False)
Comment thread
NoahStapp marked this conversation as resolved.
sys.exit(result.returncode)

# Run local tests.
Expand Down
Loading