Skip to content

Commit

Permalink
Clear the cache after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-p-smith committed May 20, 2024
1 parent 81c6fc7 commit 956121f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions code/tests/functional/tests/backend_api/default/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ def manage_app(app_port: int, app_config: AppConfig):
app_config.remove_from_environment()
EnvHelper.clear_instance()
ConfigHelper.clear_config()


@pytest.fixture(autouse=True)
def reset_default_config():
"""
Reset the default config after each test
"""
ConfigHelper.clear_config()
1 change: 1 addition & 0 deletions code/tests/utilities/helpers/test_config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def reset_default_config():
ConfigHelper.get_active_config_or_default.cache_clear()
yield
ConfigHelper._default_config = None
ConfigHelper.get_active_config_or_default.cache_clear()


def test_active_config_or_default_is_cached(env_helper_mock: MagicMock):
Expand Down

0 comments on commit 956121f

Please sign in to comment.