def test_negative(self): class A: def foo(self): pass class B(A): pass assert not overrides(B, 'foo') assert not overrides(B(), 'foo')
def test_positive(self): class A: def foo(self): pass class B(A): def foo(self): pass assert overrides(B, 'foo') assert overrides(B(), 'foo')
def test_custom_base(self): class A: def foo(self): pass class B: def foo(self): pass class C: pass assert overrides(B, 'foo', A) assert not overrides(C, 'foo', A)
def test_three_class(self): class A: def foo(self): pass class B(A): pass class C(B): def foo(self): pass assert overrides(C, 'foo') assert not overrides(B, 'foo')