Skip to content

Commit e1f50f1

Browse files
dbarbuzzidsikka
andauthored
[Tests] Add test for example in "awq" example folder (#1757)
SUMMARY: Add a test for the example script in the “examples/big_models_with_sequential_onloading” folder. TEST PLAN: Test run with this test/branch: https://github.com/neuralmagic/llm-compressor-testing/actions/runs/16997906874 The run shows that the tests are collected and executed as expected. Failures reported and resolved/being resolved separately. Signed-off-by: Domenic Barbuzzi <[email protected]> Co-authored-by: Dipika Sikka <[email protected]>
1 parent 64947e5 commit e1f50f1

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/examples/test_awq.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
from tests.examples.utils import (
6+
copy_and_run_script,
7+
gen_cmd_fail_message,
8+
requires_gpu_count,
9+
)
10+
11+
12+
@pytest.fixture
13+
def example_dir() -> str:
14+
return "examples/awq"
15+
16+
17+
@pytest.mark.example
18+
@requires_gpu_count(1)
19+
class TestAWQ:
20+
"""
21+
Tests for examples in the "awq" example folder.
22+
"""
23+
24+
@pytest.mark.parametrize(
25+
"script_filename",
26+
[
27+
"llama_example.py",
28+
"qwen3_moe_example.py",
29+
],
30+
)
31+
def test_awq_example_script(
32+
self, script_filename: str, example_dir: str, tmp_path: Path
33+
):
34+
"""
35+
Tests the example scripts in the folder.
36+
"""
37+
command, result = copy_and_run_script(tmp_path, example_dir, script_filename)
38+
39+
assert result.returncode == 0, gen_cmd_fail_message(command, result)

0 commit comments

Comments
 (0)