diff --git a/flagsmith/flagsmith.py b/flagsmith/flagsmith.py index 2f704f6..b050707 100644 --- a/flagsmith/flagsmith.py +++ b/flagsmith/flagsmith.py @@ -96,6 +96,7 @@ def __init__( EnvironmentDataPollingManager( main=self, refresh_interval_seconds=environment_refresh_interval_seconds, + daemon=True, # noqa ) ) self.environment_data_polling_manager_thread.start() diff --git a/flagsmith/polling_manager.py b/flagsmith/polling_manager.py index 0aeb512..00cc028 100644 --- a/flagsmith/polling_manager.py +++ b/flagsmith/polling_manager.py @@ -8,9 +8,13 @@ class EnvironmentDataPollingManager(threading.Thread): def __init__( - self, main: "Flagsmith", refresh_interval_seconds: typing.Union[int, float] = 10 + self, + *args, + main: "Flagsmith", + refresh_interval_seconds: typing.Union[int, float] = 10, + **kwargs ): - super(EnvironmentDataPollingManager, self).__init__() + super(EnvironmentDataPollingManager, self).__init__(*args, **kwargs) self._stop_event = threading.Event() self.main = main self.refresh_interval_seconds = refresh_interval_seconds diff --git a/tests/conftest.py b/tests/conftest.py index 75e0df3..9d3f2c8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -57,7 +57,7 @@ def local_eval_flagsmith(server_api_key, environment_json, mocker): yield flagsmith - flagsmith.__del__() + del flagsmith @pytest.fixture()