Skip to content

Commit b039f4e

Browse files
committed
Add tests for is_primary_method
1 parent b44b211 commit b039f4e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_inspect.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ def prim_method(self):
6060
])
6161
def test_is_primary(f, exp):
6262
assert vinsp.is_primary(f) == exp
63+
64+
65+
@pytest.mark.parametrize('f,exp', [
66+
(SomeClass.prim_method, False),
67+
(some_instance.prim_method, True),
68+
(SomeClass.prim_method.alt, False),
69+
(some_instance.prim_method.alt, False),
70+
(prim_func, False),
71+
(rfunc, False),
72+
(prim_func.alt, False),
73+
(prim_func.prim_group, False),
74+
(prim_func.prim_group.alt2, False),
75+
])
76+
def test_is_primary_method(f, exp):
77+
assert vinsp.is_primary_method(f) == exp

0 commit comments

Comments
 (0)