Skip to content

Commit 7810554

Browse files
committed
Reset pipeline factory in test teardown
Added a tearDown method to TestHasWCAProvidersWithWCAProvider to reset the pipeline factory after each test. This prevents test interference by ensuring a clean state between tests.
1 parent 07626b6 commit 7810554

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ansible_ai_connect/main/tests/test_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# )
2424
# from ansible_ai_connect.test_utils import WisdomServiceLogAwareTestCase
2525

26+
from django.apps import apps
2627
from django.test import override_settings
2728

2829
from ansible_ai_connect.ai.api.model_pipelines.tests import mock_config
@@ -32,6 +33,11 @@
3233

3334
@override_settings(ANSIBLE_AI_MODEL_MESH_CONFIG=mock_config("wca"))
3435
class TestHasWCAProvidersWithWCAProvider(WisdomServiceLogAwareTestCase):
36+
def tearDown(self):
37+
"""Reset pipeline factory to avoid test interference."""
38+
apps.get_app_config("ai")._pipeline_factory = None
39+
super().tearDown()
40+
3541
def test_returns_true_with_wca_provider(self):
3642
"""Test that has_wca_providers returns True when WCA provider is configured."""
3743
self.assertTrue(has_wca_providers())

0 commit comments

Comments
 (0)