Skip to content

Commit 5375412

Browse files
committed
.coverage
1 parent eca8ff0 commit 5375412

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/run_standalone_tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ printf '\n'
133133
if [[ ${#failed_tests[@]} -gt 0 ]]; then
134134
printf "Failed tests:\n"
135135
for i in "${failed_tests[@]}"; do
136-
printf "\n" * 5
137-
printf "=" * 80
136+
printf '\n%.s' {1..5}
137+
printf '=%.s' {1..80}
138138
printf "${tests[$i]}\n"
139-
printf "-" * 80
139+
printf '-%.s' {1..80}
140140
# show the output of the failed test
141141
cat "parallel_test_output-$i.txt"
142-
printf "=" * 80
142+
printf '=%.s' {1..80}
143143
done
144144
else
145145
printf "All tests passed!\n"

tests/tests_fabric/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def leave_no_artifacts_behind():
197197
files_after = {p for p in tests_root.rglob("*") if "__pycache__" not in p.parts}
198198
difference = files_after - files_before
199199
difference = {str(f.relative_to(tests_root)) for f in difference}
200+
# ignore the .coverage files
201+
difference = {f for f in difference if not f.endswith(".coverage")}
200202
assert not difference, f"Test left artifacts behind: {difference}"
201203

202204

tests/tests_pytorch/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,16 @@ def single_process_pg():
312312

313313
@pytest.fixture(autouse=True)
314314
def leave_no_artifacts_behind():
315+
"""Checks that no artifacts are left behind after the test."""
315316
tests_root = Path(__file__).parent.parent
317+
# Ignore the __pycache__ directories
316318
files_before = {p for p in tests_root.rglob("*") if "__pycache__" not in p.parts}
317319
yield
318320
files_after = {p for p in tests_root.rglob("*") if "__pycache__" not in p.parts}
319321
difference = files_after - files_before
320322
difference = {str(f.relative_to(tests_root)) for f in difference}
323+
# ignore the .coverage files
324+
difference = {f for f in difference if not f.endswith(".coverage")}
321325
assert not difference, f"Test left artifacts behind: {difference}"
322326

323327

0 commit comments

Comments
 (0)