Tech Insights
If in your tests you want to return different values when calling the same function use side_effect instead of return_value like this: mock_func.side_effect = [return_value1, return_value2]
Shared by
- Mock
- Python
- Tests



