Skip to content

Commit 1d48c12

Browse files
committed
fix mypy
1 parent b0109c9 commit 1d48c12

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,73 @@
11
# Copyright (c) 2025 OpenCyphal
22
# This software is distributed under the terms of the MIT License.
33
# Author: Huong Pham <[email protected]>
4+
from typing import List
45

56

67
def _unittest_strictify_bool() -> None:
78
# noinspection PyProtectedMember
89
from pycyphal.application.register._value import _strictify
910

1011
s = [True, False]
11-
v = _strictify(s).bit.value
12-
assert (s == v).all()
12+
v: List[bool] = _strictify(s).bit.value
13+
assert (s == v).all() # type: ignore[attr-defined]
1314

1415

1516
def _unittest_strictify_u64() -> None:
1617
# noinspection PyProtectedMember
1718
from pycyphal.application.register._value import _strictify
1819

1920
s = [x * 1000000 for x in range(30)]
21+
assert _strictify(s).natural64 is not None
2022
v = _strictify(s).natural64.value
21-
assert (s == v).all()
23+
assert (s == v).all() # type: ignore[attr-defined]
2224

2325

2426
def _unittest_strictify_u32() -> None:
2527
# noinspection PyProtectedMember
2628
from pycyphal.application.register._value import _strictify
2729

2830
s = [x * 1000000 for x in range(60)]
31+
assert _strictify(s).natural32 is not None
2932
v = _strictify(s).natural32.value
30-
assert (s == v).all()
33+
assert (s == v).all() # type: ignore[attr-defined]
3134

3235

3336
def _unittest_strictify_u16() -> None:
3437
# noinspection PyProtectedMember
3538
from pycyphal.application.register._value import _strictify
3639

3740
s = [x * 100 for x in range(80)]
41+
assert _strictify(s).natural16 is not None
3842
v = _strictify(s).natural16.value
39-
assert (s == v).all()
43+
assert (s == v).all() # type: ignore[attr-defined]
4044

4145

4246
def _unittest_strictify_i64() -> None:
4347
# noinspection PyProtectedMember
4448
from pycyphal.application.register._value import _strictify
4549

4650
s = [-x * 1000000 for x in range(30)]
51+
assert _strictify(s).integer64 is not None
4752
v = _strictify(s).integer64.value
48-
assert (s == v).all()
53+
assert (s == v).all() # type: ignore[attr-defined]
4954

5055

5156
def _unittest_strictify_i32() -> None:
5257
# noinspection PyProtectedMember
5358
from pycyphal.application.register._value import _strictify
5459

5560
s = [-x * 1000000 for x in range(60)]
61+
assert _strictify(s).integer32 is not None
5662
v = _strictify(s).integer32.value
57-
assert (s == v).all()
63+
assert (s == v).all() # type: ignore[attr-defined]
5864

5965

6066
def _unittest_strictify_i16() -> None:
6167
# noinspection PyProtectedMember
6268
from pycyphal.application.register._value import _strictify
6369

6470
s = [-x * 100 for x in range(80)]
71+
assert _strictify(s).integer16 is not None
6572
v = _strictify(s).integer16.value
66-
assert (s == v).all()
73+
assert (s == v).all() # type: ignore[attr-defined]

0 commit comments

Comments
 (0)