Skip to content

Commit 9aa5d10

Browse files
committed
fix ruff format
1 parent 50465a3 commit 9aa5d10

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

spy/tests/compiler/unsafe/test_sizeof.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
from spy.vm.modules.unsafe.misc import sizeof
55

66

7-
@pytest.mark.parametrize("w_T, expected", [
8-
(B.w_i8, 1),
9-
(B.w_u8, 1),
10-
(B.w_i32, 4),
11-
(B.w_u32, 4),
12-
(B.w_f32, 4),
13-
(B.w_f64, 8),
14-
])
7+
@pytest.mark.parametrize(
8+
"w_T, expected",
9+
[
10+
(B.w_i8, 1),
11+
(B.w_u8, 1),
12+
(B.w_i32, 4),
13+
(B.w_u32, 4),
14+
(B.w_f32, 4),
15+
(B.w_f64, 8),
16+
],
17+
)
1518
def test_sizeof_primitives(w_T, expected):
1619
assert sizeof(w_T) == expected

spy/tests/wasm_wrapper.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,16 @@ def __init__(
8888
self.w_functype = w_functype
8989

9090
def py2wasm(self, pyval: Any, w_T: W_Type) -> Any:
91-
if w_T in (B.w_i32, B.w_u32, B.w_i8, B.w_u8, B.w_i64, B.w_u64,
92-
B.w_f64, B.w_bool):
91+
if w_T in (
92+
B.w_i32,
93+
B.w_u32,
94+
B.w_i8,
95+
B.w_u8,
96+
B.w_i64,
97+
B.w_u64,
98+
B.w_f64,
99+
B.w_bool,
100+
):
93101
return pyval
94102
elif w_T is B.w_complex128:
95103
return (pyval.real, pyval.imag)
@@ -135,8 +143,16 @@ def to_py_result(self, w_T: W_Type, res: Any) -> Any:
135143
if w_T is TYPES.w_NoneType:
136144
assert res is None
137145
return None
138-
elif w_T in (B.w_i8, B.w_u8, B.w_i32, B.w_u32, B.w_i64, B.w_u64,
139-
B.w_f64, B.w_f32):
146+
elif w_T in (
147+
B.w_i8,
148+
B.w_u8,
149+
B.w_i32,
150+
B.w_u32,
151+
B.w_i64,
152+
B.w_u64,
153+
B.w_f64,
154+
B.w_f32,
155+
):
140156
return res
141157
elif w_T is B.w_complex128:
142158
real, imag = res

0 commit comments

Comments
 (0)