Skip to content

Commit

Permalink
More work with cleanup of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Griatch committed Dec 2, 2023
1 parent 48fdc2c commit 0f39677
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions evennia/contrib/rpg/llm/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
from anything import Something
from django.test import override_settings
from evennia.utils.create import create_object
from evennia.utils.test_resources import EvenniaTestCase
from evennia.utils.test_resources import BaseEvenniaTestCase
from mock import Mock, patch

from .llm_npc import LLMNPC


class TestLLMClient(EvenniaTestCase):
class TestLLMClient(BaseEvenniaTestCase):
@override_settings(LLM_PROMPT_PREFIX="You are a test bot.", TEST_ENVIRONMENT=True)
@patch("evennia.contrib.rpg.llm.llm_npc.task.deferLater")
def test_npc_at_talked_to(self, mock_deferLater):
Expand Down
5 changes: 4 additions & 1 deletion evennia/utils/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
BASE_GUEST_TYPECLASS="evennia.accounts.accounts.DefaultGuest",
# a special setting boolean TEST_ENVIRONMENT is set by the test runner
# while the test suite is running.
TEST_ENVIRONMENT=True
TEST_ENVIRONMENT=True,
)

DEFAULT_SETTINGS = {**all_from_module(settings_default), **DEFAULT_SETTING_RESETS}
Expand Down Expand Up @@ -548,6 +548,9 @@ class BaseEvenniaTestCase(TestCase):
"""

def tearDown(self) -> None:
flush_cache()


class EvenniaTestCase(TestCase):
"""
Expand Down

0 comments on commit 0f39677

Please sign in to comment.