Skip to content

Commit b713061

Browse files
committed
python: add test for inheritance
1 parent 824d4d5 commit b713061

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from foo import A, B
2+
3+
def func():
4+
if cond():
5+
class Foo(A): pass
6+
else:
7+
class Foo(B): pass
8+
9+
class Bar(A): pass
10+
class Bar(B): pass
11+
12+
class Baz(A): pass
13+
14+
def other_func():
15+
print(Foo) #$ use=moduleImport("foo").getMember("A").getASubclass() use=moduleImport("foo").getMember("B").getASubclass()
16+
print(Bar) #$ use=moduleImport("foo").getMember("B").getASubclass() MISSING: use=moduleImport("foo").getMember("A").getASubclass() The MISSING here is documenting correct behaviour
17+
print(Baz) #$ use=moduleImport("foo").getMember("B").getASubclass() SPURIOUS: use=moduleImport("foo").getMember("A").getASubclass()
18+
19+
class Baz(B): pass
20+
21+
other_func()

0 commit comments

Comments
 (0)