@@ -369,15 +369,27 @@ def _make_factory_with_apikey(apikey, *_, **__):
369369 get_factory ('some_api_key' )
370370 assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 2
371371 assert factory_module_logger .warning .mock_calls == [mocker .call (
372- "factory instantiation: You already have %d factories with this API Key. "
372+ "factory instantiation: You already have %d %s with this API Key. "
373373 "We recommend keeping only one instance of the factory at all times "
374374 "(Singleton pattern) and reusing it throughout your application." ,
375- 1
375+ 1 ,
376+ 'factory'
377+ )]
378+
379+ factory_module_logger .reset_mock ()
380+ get_factory ('some_api_key' )
381+ assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 3
382+ assert factory_module_logger .warning .mock_calls == [mocker .call (
383+ "factory instantiation: You already have %d %s with this API Key. "
384+ "We recommend keeping only one instance of the factory at all times "
385+ "(Singleton pattern) and reusing it throughout your application." ,
386+ 2 ,
387+ 'factories'
376388 )]
377389
378390 factory_module_logger .reset_mock ()
379391 get_factory ('some_other_api_key' )
380- assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 2
392+ assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 3
381393 assert _INSTANTIATED_FACTORIES ['some_other_api_key' ] == 1
382394 assert factory_module_logger .warning .mock_calls == [mocker .call (
383395 "factory instantiation: You already have an instance of the Split factory. "
@@ -390,4 +402,4 @@ def _make_factory_with_apikey(apikey, *_, **__):
390402 factory1 .destroy (event )
391403 event .wait ()
392404 assert _INSTANTIATED_FACTORIES ['some_other_api_key' ] == 1
393- assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 1
405+ assert _INSTANTIATED_FACTORIES ['some_api_key' ] == 2
0 commit comments