Skip to content

Commit 1fdb7c6

Browse files
committed
Update tests a bit
1 parent 8d521d2 commit 1fdb7c6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

mypyc/test-data/run-classes.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,10 +1163,12 @@ class Bar(Foo):
11631163
z: Foo = Bar()
11641164
z.f(1, z=2)
11651165
z.f(1, 2, 3)
1166+
# z.f(x=5) # Not tested because we (knowingly) do the wrong thing and pass it as positional
11661167

11671168
[out]
11681169
Bar (1,) {'z': 2}
11691170
Bar (1, 2, 3) {}
1171+
--Bar () {'x': 5}
11701172

11711173
[case testMethodOverrideDefault8]
11721174
from typing import TypeVar, Any
@@ -1214,6 +1216,10 @@ z: Foo = Baz()
12141216
z.f()
12151217
z.f(y=1)
12161218
z.f(1, 2)
1219+
# Not tested because we don't (and probably won't) match cpython here
1220+
# from testutil import assertRaises
1221+
# with assertRaises(TypeError):
1222+
# z.f(x=7)
12171223

12181224
[out]
12191225
Baz 30 50

mypyc/test-data/run-python38.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ class Bar(Foo):
7878
z: Foo = Bar()
7979
z.f(1, z=50)
8080
z.f()
81+
z.f(1)
82+
z.f(z=50)
8183

8284
[out]
8385
stuff (1,) {'z': 50}
8486
stuff () {}
87+
stuff (1,) {}
88+
stuff () {'z': 50}

0 commit comments

Comments
 (0)