diff --git a/tests/_test_msui/conftest.py b/tests/_test_msui/conftest.py new file mode 100644 index 000000000..6ccfa2ffb --- /dev/null +++ b/tests/_test_msui/conftest.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +""" + + tests._test_msui.conftest + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + common definitions for _test_msui + + This file is part of MSS. + + :copyright: Copyright 2016-2017 Reimar Bauer + :copyright: Copyright 2016-2026 by the MSS team, see AUTHORS. + :license: APACHE-2.0, see LICENSE for details. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" +import pytest +from mslib.utils.service_manager import WMSServiceManager + + +@pytest.fixture(autouse=True) +def _reset_wms_service_manager(): + WMSServiceManager._shared_cache.clear() + yield + WMSServiceManager._shared_cache.clear() diff --git a/tests/_test_msui/test_wms_control.py b/tests/_test_msui/test_wms_control.py index 219964c04..4bb238f52 100644 --- a/tests/_test_msui/test_wms_control.py +++ b/tests/_test_msui/test_wms_control.py @@ -33,7 +33,6 @@ import eventlet from PyQt5 import QtCore, QtTest from mslib.msui import flighttrack as ft -from mslib.utils.service_manager import WMSServiceManager import mslib.msui.wms_control as wc @@ -57,8 +56,6 @@ def _with_mswms_server(self, mswms_server): self.scheme, self.host, self.port = parsed_url.scheme, parsed_url.hostname, parsed_url.port def _setup(self, widget_type, tmp_path): - self.service_manager = WMSServiceManager() - self.service_manager.clear_cache() if widget_type == "hsec": self.view = HSecViewMockup() else: @@ -500,8 +497,6 @@ class TestWMSControlWidgetSetupSimple: @pytest.fixture(autouse=True) def setup(self, tmp_path, qtbot): - self.service_manager = WMSServiceManager() - self.service_manager.clear_cache() self.view = HSecViewMockup() self.tempdir = tmp_path self.window = wc.HSecWMSControlWidget(view=self.view, wms_cache=self.tempdir)