Skip to content

Commit 3ff1d94

Browse files
committed
Reset ModelPipelineFactory in test teardown
Updates the test teardown to explicitly reset the ModelPipelineFactory instance, ensuring tests do not interfere with each other by sharing state.
1 parent 7810554 commit 3ff1d94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ansible_ai_connect/main/tests/test_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from django.apps import apps
2727
from django.test import override_settings
2828

29+
from ansible_ai_connect.ai.api.model_pipelines.factory import ModelPipelineFactory
2930
from ansible_ai_connect.ai.api.model_pipelines.tests import mock_config
3031
from ansible_ai_connect.main.utils import has_wca_providers
3132
from ansible_ai_connect.test_utils import WisdomServiceLogAwareTestCase
@@ -35,7 +36,8 @@
3536
class TestHasWCAProvidersWithWCAProvider(WisdomServiceLogAwareTestCase):
3637
def tearDown(self):
3738
"""Reset pipeline factory to avoid test interference."""
38-
apps.get_app_config("ai")._pipeline_factory = None
39+
# Force recreation of the factory with current configuration
40+
apps.get_app_config("ai")._pipeline_factory = ModelPipelineFactory()
3941
super().tearDown()
4042

4143
def test_returns_true_with_wca_provider(self):

0 commit comments

Comments
 (0)