diff --git a/test/test_run_modules/test_partition_check.py b/test/test_run_modules/test_partition_check.py index 1e576a8ce47c98e395468b76d3496dafa3cc0525..ba5b3d7ef127258eaa6c4f2a1a0b4d0b531eeac5 100644 --- a/test/test_run_modules/test_partition_check.py +++ b/test/test_run_modules/test_partition_check.py @@ -5,7 +5,6 @@ import mock from mlair.run_modules.experiment_setup import ExperimentSetup from mlair.run_modules.partition_check import PartitionCheck from mlair.run_modules.run_environment import RunEnvironment -from mlair.configuration import get_host class TestPartitionCheck: @@ -24,6 +23,7 @@ class TestPartitionCheck: @mock.patch("os.path.exists", return_value=False) @mock.patch("os.makedirs", side_effect=None) def obj_with_exp_setup_login(self, mock_host, mock_user, mock_path, mock_check): + RunEnvironment().__del__() ExperimentSetup(stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001'], statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background") pre = object.__new__(PartitionCheck) @@ -37,6 +37,7 @@ class TestPartitionCheck: @mock.patch("os.path.exists", return_value=False) @mock.patch("os.makedirs", side_effect=None) def obj_with_exp_setup_compute(self, mock_host, mock_user, mock_path, mock_check): + RunEnvironment().__del__() ExperimentSetup(stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001'], statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background") pre = object.__new__(PartitionCheck) @@ -71,5 +72,5 @@ class TestPartitionCheck: @mock.patch("os.path.exists", return_value=False) @mock.patch("os.makedirs", side_effect=None) def test_run_compute(self, mock_host, mock_user, mock_path, mock_check, obj_with_exp_setup_compute, caplog): - - assert obj_with_exp_setup_compute.__next__()._run() is None + obj = obj_with_exp_setup_compute.__next__() + assert obj._run() is None