Skip to content

Commit 1be5027

Browse files
northdpoleclaude
andcommitted
test(feedback): restore NO_LOAD_GRAPH_DB after each feedback test
Fold into the feedback commits during the cleanup pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 1acf9e2 commit 1be5027

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎application/tests/answer_feedback_test.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import os
22
import unittest
3+
from unittest import mock
34

45
from application import create_app, sqla
56
from application.utils import answer_feedback as af
67

78

89
class AnswerFeedbackTest(unittest.TestCase):
910
def setUp(self) -> None:
10-
os.environ["NO_LOAD_GRAPH_DB"] = "1"
11+
patcher = mock.patch.dict(os.environ, {"NO_LOAD_GRAPH_DB": "1"})
12+
patcher.start()
13+
self.addCleanup(patcher.stop)
1114
self.app = create_app(mode="test")
1215
self.ctx = self.app.app_context()
1316
self.ctx.push()
@@ -82,7 +85,9 @@ def test_attach_answer_id_adds_id_only_when_logged(self) -> None:
8285

8386
class McpRatingTest(unittest.TestCase):
8487
def setUp(self) -> None:
85-
os.environ["NO_LOAD_GRAPH_DB"] = "1"
88+
patcher = mock.patch.dict(os.environ, {"NO_LOAD_GRAPH_DB": "1"})
89+
patcher.start()
90+
self.addCleanup(patcher.stop)
8691
self.app = create_app(mode="test")
8792
self.ctx = self.app.app_context()
8893
self.ctx.push()
@@ -126,7 +131,9 @@ def test_rate_tool_is_listed_and_dispatches(self) -> None:
126131

127132
class RestFeedbackTest(unittest.TestCase):
128133
def setUp(self) -> None:
129-
os.environ["NO_LOAD_GRAPH_DB"] = "1"
134+
patcher = mock.patch.dict(os.environ, {"NO_LOAD_GRAPH_DB": "1"})
135+
patcher.start()
136+
self.addCleanup(patcher.stop)
130137
self.app = create_app(mode="test")
131138
self.ctx = self.app.app_context()
132139
self.ctx.push()

0 commit comments

Comments
 (0)