Skip to content

Commit 69eb9e6

Browse files
committed
chore: better test logs
1 parent 92d7572 commit 69eb9e6

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/pr-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ jobs:
108108
pwd
109109
cd ../ComfyUI
110110
python nunchaku_tests/scripts/nunchaku-flux1-dev.py
111-
pytest -s nunchaku_tests/
111+
pytest -s -x nunchaku_tests/
112112
- name: Run nunchaku tests
113113
run: |
114114
source $(conda info --base)/etc/profile.d/conda.sh
115115
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
116116
which python
117-
pytest -s tests/flux/test_flux_examples.py
117+
pytest -s -x tests/flux/test_flux_examples.py
118118
python .github/workflows/run_all_tests.py
119119
- name: clean up
120120
if: always()

.github/workflows/run_all_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def run_all_tests():
2121
failed_tests = []
2222
for test_file in test_files:
2323
print(f"Running {test_file} ...")
24-
result = subprocess.run(["pytest", "--reruns", "2", "--reruns-delay", "0", "-s", test_file])
24+
result = subprocess.run(["pytest", "--reruns", "2", "--reruns-delay", "0", "-s", "-x", test_file])
2525
if result.returncode != 0:
2626
print(f"Test failed: {test_file}")
2727
failed_tests.append(test_file)

tests/flux/test_flux_examples.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
@pytest.mark.parametrize("script_name", example_scripts)
1414
def test_example_script_runs(script_name):
15-
gc.collect()
16-
torch.cuda.empty_cache()
1715
script_path = os.path.join(EXAMPLES_DIR, script_name)
18-
result = subprocess.run(["python", script_path], capture_output=True, text=True)
16+
result = subprocess.run(["python", script_path], text=True)
1917
print(f"Running {script_path} -> Return code: {result.returncode}")
2018
assert result.returncode == 0, f"{script_path} failed with code {result.returncode}"

0 commit comments

Comments
 (0)