File tree Expand file tree Collapse file tree
tests_integration/producer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,11 +109,15 @@ def test_publish_inbound_message_publishes_to_retries_and_succeeds_on_last_attem
109109 test_client : TestClient ,
110110 captured_logs : list [MutableMapping [str , Any ]],
111111):
112- mock_publish_to_outbound .side_effect = [
113- ValueError ("First failure" ),
114- ValueError ("Second failure" ),
115- None ,
116- ]
112+ async def publish_outbound_side_effect_logic (* args , ** kwargs ):
113+ if mock_publish_to_outbound .call_count == 1 :
114+ raise ValueError ("First failure" )
115+ if mock_publish_to_outbound .call_count == 2 :
116+ raise TypeError ("Second failure" )
117+ # Call 3 and all future calls fall back to returning None
118+ return None
119+
120+ mock_publish_to_outbound .side_effect = publish_outbound_side_effect_logic
117121
118122 sample1 : Sample = Sample (
119123 id = uuid .uuid4 (),
You can’t perform that action at this time.
0 commit comments