I have a Test class with as many as 50 different method. I want to patch every method with a mock function.
prod = {"foo": "bar"}
def TestClass:
@patch(db.get_product, return_value=prod)
def test_1:
pass
@patch(db.get_product, return_value=prod)
def test_2:
pass
.
.
.
@patch(db.get_product, return_value=prod)
def test_50:
pass
Is there any easy way to do this instead of repeating @patch(db.get_product, return=prod) 50 times?