@@ -227,19 +227,22 @@ async def test_get_variant_value_tracks_exposure_when_variant_selected(self):
227
227
with patch ('mixpanel.flags.utils.normalized_hash' ) as mock_hash :
228
228
mock_hash .return_value = 0.5
229
229
_ = flags .get_variant_value ("test_flag" , "fallback" , {"distinct_id" : "user123" })
230
+ flags ._executor .shutdown ()
230
231
flags ._tracker .assert_called_once ()
231
232
232
233
@respx .mock
233
234
async def test_get_variant_value_does_not_track_exposure_on_fallback (self ):
234
235
flags = await self .setup_flags ([])
235
236
_ = flags .get_variant_value ("nonexistent_flag" , "fallback" , {"distinct_id" : "user123" })
237
+ flags ._executor .shutdown ()
236
238
flags ._tracker .assert_not_called ()
237
239
238
240
@respx .mock
239
241
async def test_get_variant_value_does_not_track_exposure_without_distinct_id (self ):
240
242
flag = create_test_flag (context = "company" )
241
243
flags = await self .setup_flags ([flag ])
242
244
_ = flags .get_variant_value ("nonexistent_flag" , "fallback" , {"company_id" : "company123" })
245
+ flags ._executor .shutdown ()
243
246
flags ._tracker .assert_not_called ()
244
247
245
248
@respx .mock
@@ -283,7 +286,6 @@ async def track_fetch_calls(self):
283
286
284
287
flags_in_order = [[flag_v1 ], [flag_v2 ]]
285
288
flags = await self .setup_flags_with_polling (flags_in_order )
286
-
287
289
async with polling_limit_check :
288
290
await polling_limit_check .wait_for (lambda : polling_iterations >= len (flags_in_order ))
289
291
0 commit comments