From d1611cbf7466bcd720e05b8c0a33ca96affa3b12 Mon Sep 17 00:00:00 2001 From: kdmukai Date: Sun, 23 Jan 2022 10:21:43 -0600 Subject: [PATCH] Update test_controller.py --- tests/test_controller.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_controller.py b/tests/test_controller.py index b18df68e..ef3e7ea3 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -18,6 +18,13 @@ def test_singleton_get_instance_without_configure_fails(): def test_singleton_get_instance_preserves_state(): """ Changes to the Controller singleton should be preserved across calls to get_instance() """ + + # Must reset Singleton instances; pytest cannot properly isolate Singletons for us + # automatically. + # TODO: Cleaner solution here would be nice. + Settings._instance = None + Controller._instance = None + settings = """ [system] debug = False @@ -58,6 +65,7 @@ def test_missing_settings_get_defaults(): # Must reset Singleton instances; pytest cannot properly isolate Singletons for us # automatically. + # TODO: Cleaner solution here would be nice. Settings._instance = None Controller._instance = None