I have some application method that uses the @typeguard.typechecked decorator for performing runtime checks of the passed parameters:
class SalesDeal:
pass
@typechecked
def do_something(deal: SalesDeal):
pass
Inside a test I have fake class FakeSalesDeal which implements a minimal mock for SalesDeal (which is a very complicated class in reality):
class FakeSalesDeal:
pass
def test_foo():
deal = FakeSalesDeal()
do_something(deal)
This test will of course fail because the @typechecked decorator will raise an error due to a different class.
Is there a way to mock/fake the class of FakeSalesDeal in order make the test pass?