Skip to content

Commit

Permalink
- switched to using pytest-cleanslate for test isolation;
Browse files Browse the repository at this point in the history
  • Loading branch information
jaltmayerpizzorno committed May 15, 2024
1 parent fb4499a commit b8bb140
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
"aiolimiter",
"tqdm",
"slipcover>=1.0.13",
"pytest-forked",
"pytest-cleanslate",
"litellm>=1.33.1"
]

Expand Down
6 changes: 3 additions & 3 deletions src/coverup/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def measure_suite_coverage(*, tests_dir: Path, source_dir: Path, pytest_args='',
command = [sys.executable,
'-m', 'slipcover', '--source', source_dir] + (['--branch'] if branch_coverage else []) + \
['--json', '--out', j.name] + \
(['--isolate-tests'] if isolate_tests else []) + \
['-m', 'pytest'] + pytest_args.split() + ['--disable-warnings', '-x', tests_dir]
['-m', 'pytest'] + pytest_args.split() + (['--cleanslate'] if isolate_tests else []) + \
['--disable-warnings', '-x', tests_dir]

if trace: trace(command)
p = subprocess.run(command, check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if p.returncode not in (pytest.ExitCode.OK, pytest.ExitCode.NO_TESTS_COLLECTED):
if trace: trace(f"tests rc={p.returncode}")
if trace: trace(f"tests rc={p.returncode}\n" + str(p.stdout, 'utf-8'))
p.check_returncode()

try:
Expand Down

0 comments on commit b8bb140

Please sign in to comment.