aboutsummaryrefslogtreecommitdiff
path: root/tests/basics/fun-kwonly.py
diff options
context:
space:
mode:
authorDamien George2014-07-05 06:14:29 +0100
committerDamien George2014-07-05 06:14:29 +0100
commit539681fffd96082ca3b5d18643d4f08f65c47170 (patch)
tree7e6f8332c6e7737b768750e67265bb02b22932e6 /tests/basics/fun-kwonly.py
parent0182385ab0b4a1b2e549c92f8f5b621135aeb975 (diff)
tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore. Addresses issue #727.
Diffstat (limited to 'tests/basics/fun-kwonly.py')
-rw-r--r--tests/basics/fun-kwonly.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/basics/fun-kwonly.py b/tests/basics/fun-kwonly.py
deleted file mode 100644
index bdff3a821..000000000
--- a/tests/basics/fun-kwonly.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# to test keyword-only arguments
-
-# simplest case
-def f(*, a):
- print(a)
-
-f(a=1)
-
-# with 2 keyword-only args
-def f(*, a, b):
- print(a, b)
-
-f(a=1, b=2)
-f(b=1, a=2)
-
-# positional followed by bare star
-def f(a, *, b, c):
- print(a, b, c)
-
-f(1, b=3, c=4)
-f(1, c=3, b=4)
-f(1, **{'b':'3', 'c':4})
-
-try:
- f(1)
-except TypeError:
- print("TypeError")
-
-try:
- f(1, b=2)
-except TypeError:
- print("TypeError")
-
-try:
- f(1, c=2)
-except TypeError:
- print("TypeError")
-
-# with **kw
-def f(a, *, b, **kw):
- print(a, b, kw)
-
-f(1, b=2)
-f(1, b=2, c=3)
-
-# with named star
-def f(*a, b, c):
- print(a, b, c)
-
-f(b=1, c=2)
-f(c=1, b=2)
-
-# with positional and named star
-def f(a, *b, c):
- print(a, b, c)
-
-f(1, c=2)
-f(1, 2, c=3)
-f(a=1, c=3)