10000 ENH: Refactor the typing "reveal" tests using `typing.assert_type` by BvB93 · Pull Request #24637 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Refactor the typing "reveal" tests using typing.assert_type #24637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TYP: More np.ctypeslib test fixes for windows
  • Loading branch information
BvB93 committed Sep 4, 2023
commit 6d4d5aa6db18fdd969a447297bd8d2a050e6b8ef
7 changes: 5 additions & 2 deletions numpy/typing/tests/data/reveal/ctypeslib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ assert_type(np.ctypeslib.as_ctypes(AR_bool.take(0)), ct.c_bool)
assert_type(np.ctypeslib.as_ctypes(AR_ubyte.take(0)), ct.c_ubyte)
assert_type(np.ctypeslib.as_ctypes(AR_ushort.take(0)), ct.c_ushort)
assert_type(np.ctypeslib.as_ctypes(AR_uintc.take(0)), ct.c_uint)
assert_type(np.ctypeslib.as_ctypes(AR_uint.take(0)), ct.c_ulong)

assert_type(np.ctypeslib.as_ctypes(AR_byte.take(0)), ct.c_byte)
assert_type(np.ctypeslib.as_ctypes(AR_short.take(0)), ct.c_short)
assert_type(np.ctypeslib.as_ctypes(AR_intc.take(0)), ct.c_int)
assert_type(np.ctypeslib.as_ctypes(AR_int.take(0)), ct.c_long)
assert_type(np.ctypeslib.as_ctypes(AR_single.take(0)), ct.c_float)
assert_type(np.ctypeslib.as_ctypes(AR_double.take(0)), ct.c_double)
assert_type(np.ctypeslib.as_ctypes(AR_void.take(0)), Any)
Expand All @@ -85,8 +84,12 @@ if sys.platform == "win32":
assert_type(np.ctypeslib.as_ctypes_type(np.uint), type[ct.c_uint])
assert_type(np.ctypeslib.as_ctypes(AR_uint), ct.Array[ct.c_uint])
assert_type(np.ctypeslib.as_ctypes(AR_int), ct.Array[ct.c_int])
assert_type(np.ctypeslib.as_ctypes(AR_uint.take(0)), ct.c_uint)
assert_type(np.ctypeslib.as_ctypes(AR_int.take(0)), ct.c_int)
else:
assert_type(np.ctypeslib.as_ctypes_type(np.int_), type[ct.c_long])
assert_type(np.ctypeslib.as_ctypes_type(np.uint), type[ct.c_ulong])
assert_type(np.ctypeslib.as_ctypes(AR_uint), ct.Array[ct.c_ulong])
assert_type(np.ctypeslib.as_ctypes(AR_int), ct.Array[ct.c_long])
assert_type(np.ctypeslib.as_ctypes(AR_uint.take(0)), ct.c_ulong)
assert_type(np.ctypeslib.as_ctypes(AR_int.take(0)), ct.c_long)
0