Skip to content

Commit

Permalink
Run coverage report with whichever Python version calls the script.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-hen committed Oct 18, 2021
1 parent 5a549fd commit 608278a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deploy/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@

from subprocess import run
from pathlib import Path
import sys

tests = ['meta', 'config', 'discovery', 'server', 'session', 'standalone',
'client', 'multi', 'node', 'model', 'exit']

here = Path(__file__).resolve().parent
root = here.parent
file = root/'coverage.xml'
here = Path(__file__).resolve().parent
root = here.parent
file = root/'coverage.xml'
python = sys.executable
if not file.exists():
command = ['pytest', '--cov', '--cov-append', '--cov-report', 'xml']
command = [python, '-m', 'pytest',
'--cov', '--cov-append', '--cov-report', 'xml']
for test in tests:
run(command + [f'tests/test_{test}.py'], cwd=root)
else:
Expand Down

0 comments on commit 608278a

Please sign in to comment.