Skip to content

Commit 3bf35c0

Browse files
committed
[NFC] Apply format on test files
1 parent 5e3dfb1 commit 3bf35c0

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

tests/test_torch_custom_pipeline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def test_torch_custom_pipeline(ir_type):
4040
output = response.json()["output"]
4141

4242
assert "===== Initial IR =====" in output
43-
assert "llvm.func @main(%arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: i64, %arg3: i64, %arg4: i64, %arg5: i64, %arg6: i64)" in output
43+
assert (
44+
"llvm.func @main(%arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: i64, %arg3: i64, %arg4: i64, %arg5: i64, %arg6: i64)"
45+
in output
46+
)
4447
assert "===== IR after mlir-translate --mlir-to-llvmir =====" in output
4548
assert "define { ptr, ptr, i64, [2 x i64], [2 x i64] } @main" in output
4649
assert "===== IR after llc -mtriple=nvptx64 =====" in output

tests/test_torch_mlir_linear.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
API_URL = os.environ.get("API_URL", "http://localhost:8000/generate_ir")
66

7+
78
def test_torch_mlir_linear():
89
code = """
910
import torch

tests/test_torch_mock_opt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66
import httpx
77

8+
89
@pytest.fixture(scope="session")
910
def mock_opt_path():
1011
cpp_src = os.path.abspath("tests/cpp_sources/mock-opt.cpp")
@@ -17,6 +18,7 @@ def mock_opt_path():
1718

1819
shutil.rmtree(build_dir)
1920

21+
2022
def test_torch_mock_opt(mock_opt_path):
2123
code = """
2224
import torch
@@ -41,7 +43,9 @@ def forward(self, x):
4143
"dump_after_each_opt": True,
4244
}
4345

44-
response = httpx.post(os.environ.get("API_URL", "http://localhost:8000/generate_ir"), json=payload)
46+
response = httpx.post(
47+
os.environ.get("API_URL", "http://localhost:8000/generate_ir"), json=payload
48+
)
4549
assert response.status_code == 200
4650
assert "graph(%self.1 : __torch__.builtins.MyModel," in response.json()["output"]
4751
assert "test mock_opt 42" in response.json()["output"]

tests/test_torch_user_controlled_ir_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ def forward(self, x):
4848
assert "affine_map" in ir
4949
assert "memref.global" in ir
5050
assert "arith.constant" in ir
51-
assert "linalg.matmul" in ir
51+
assert "linalg.matmul" in ir

tests/test_triton_mock_opt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
reason="No NVIDIA GPU detected. Skip",
1313
)
1414

15+
1516
@pytest.fixture(scope="session")
1617
def mock_opt_path():
1718
cpp_src = os.path.abspath("tests/cpp_sources/mock-opt.cpp")
@@ -24,6 +25,7 @@ def mock_opt_path():
2425

2526
shutil.rmtree(build_dir)
2627

28+
2729
def test_triton_mock_opt(mock_opt_path):
2830
code = """
2931
import triton

tests/test_wrong_command_line.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def forward(self, x):
2020
example_input = torch.randn(4, 4)
2121
"""
2222

23+
2324
@pytest.mark.parametrize("ir_type", ["llvm_mlir"])
2425
def test_wrong_command_line(ir_type):
2526
payload = {

0 commit comments

Comments
 (0)