File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,16 @@ You should now be able to call the function:
334334 Note that our ``spam.system `` does not yet run the ``whoami `` command;
335335it only returns ``None ``.
336336
337+ Check that the function accepts exactly one argument, as specified by
338+ the :c:data: `METH_O ` flag:
339+
340+ .. code-block :: pycon
341+
342+ >>> print(spam.system('too', 'many', 'arguments'))
343+ Traceback (most recent call last):
344+ ...
345+ TypeError: spam.system() takes exactly one argument (3 given)
346+
337347
338348 Returning an integer
339349====================
@@ -495,11 +505,6 @@ You might also want to test error cases:
495505 ...
496506 TypeError: bad argument type for built-in operation
497507
498- >>> print(spam.system('too', 'many', 'arguments'))
499- Traceback (most recent call last):
500- ...
501- TypeError: spam.system() takes exactly one argument (3 given)
502-
503508
504509 The result
505510==========
You can’t perform that action at this time.
0 commit comments