Skip to content

Commit c6d59e6

Browse files
committed
Docstring for ph.assert_kw_dtype()
1 parent bfa3961 commit c6d59e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

array_api_tests/pytest_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ def assert_dtype(
127127

128128

129129
def assert_kw_dtype(func_name: str, kw_dtype: DataType, out_dtype: DataType):
130+
"""
131+
Test the output dtype is the passed keyword dtype, e.g.
132+
133+
>>> kw = {'dtype': xp.uint8}
134+
>>> out = xp.ones(5, **kw)
135+
>>> assert_kw_dtype('ones', kw['dtype'], out.dtype)
136+
137+
"""
130138
f_kw_dtype = dh.dtype_to_name[kw_dtype]
131139
f_out_dtype = dh.dtype_to_name[out_dtype]
132140
msg = (

0 commit comments

Comments
 (0)