parameterized icon indicating copy to clipboard operation
parameterized copied to clipboard

Is is possible to combine @parameterized_class with existing @patch decorators?

Open raner opened this issue 4 years ago • 0 comments

I have a piece of code similar to the following:

@patch('service.account.utils.AccountManager.get_service', MOCK_SERVICE)
# ... more @patch decorators ...
@parameterized_class('provider', [
   (GCPServiceProvider(),),
   (AWSServiceProvider(),),
])
class ServiceTestCase(BaseTestCase):
# ... tests

Should it be possible to use @parameterized_class in conjunction with existing @patch decorators at the class level? When I add the @parameterized_class annotation I end up with a No tests were found message and no tests being executed at all. The same thing happens independent of whether I add the @parameterized_class decorator as the first or the last decorator in the stack.

Is this generally supported or am I combining things that don't really go together?

raner avatar May 14 '21 03:05 raner