Skip to content

Commit 8175016

Browse files
committed
test_struct: add test for Struct.pack arity check
1 parent 453d042 commit 8175016

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_struct.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,13 @@ def test_iter_unpack():
259259
assert lh(it) == 0
260260
assert_raises(StopIteration, next, it)
261261
assert lh(it) == 0
262+
263+
264+
def test_pack_varargs():
265+
assert struct.Struct(">B").pack(3) == b'\x03'
266+
raised = False
267+
try:
268+
struct.Struct(">B").pack(3, kw=1)
269+
except TypeError:
270+
raised = True
271+
assert raised

0 commit comments

Comments
 (0)