Skip to content
Snippets Groups Projects
Commit b96f652f authored by lukas leufen's avatar lukas leufen
Browse files

better test cleanup

parent 766f8d04
No related branches found
No related tags found
4 merge requests!136update release branch,!135Release v0.11.0,!134MLAir is decoupled from join,!119Resolve "Include advanced data handling in workflow"
Pipeline #43670 passed
...@@ -5,7 +5,6 @@ import mock ...@@ -5,7 +5,6 @@ import mock
from mlair.run_modules.experiment_setup import ExperimentSetup from mlair.run_modules.experiment_setup import ExperimentSetup
from mlair.run_modules.partition_check import PartitionCheck from mlair.run_modules.partition_check import PartitionCheck
from mlair.run_modules.run_environment import RunEnvironment from mlair.run_modules.run_environment import RunEnvironment
from mlair.configuration import get_host
class TestPartitionCheck: class TestPartitionCheck:
...@@ -24,6 +23,7 @@ class TestPartitionCheck: ...@@ -24,6 +23,7 @@ class TestPartitionCheck:
@mock.patch("os.path.exists", return_value=False) @mock.patch("os.path.exists", return_value=False)
@mock.patch("os.makedirs", side_effect=None) @mock.patch("os.makedirs", side_effect=None)
def obj_with_exp_setup_login(self, mock_host, mock_user, mock_path, mock_check): 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'], ExperimentSetup(stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001'],
statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background") statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background")
pre = object.__new__(PartitionCheck) pre = object.__new__(PartitionCheck)
...@@ -37,6 +37,7 @@ class TestPartitionCheck: ...@@ -37,6 +37,7 @@ class TestPartitionCheck:
@mock.patch("os.path.exists", return_value=False) @mock.patch("os.path.exists", return_value=False)
@mock.patch("os.makedirs", side_effect=None) @mock.patch("os.makedirs", side_effect=None)
def obj_with_exp_setup_compute(self, mock_host, mock_user, mock_path, mock_check): 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'], ExperimentSetup(stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087', 'DEBW001'],
statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background") statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'}, station_type="background")
pre = object.__new__(PartitionCheck) pre = object.__new__(PartitionCheck)
...@@ -71,5 +72,5 @@ class TestPartitionCheck: ...@@ -71,5 +72,5 @@ class TestPartitionCheck:
@mock.patch("os.path.exists", return_value=False) @mock.patch("os.path.exists", return_value=False)
@mock.patch("os.makedirs", side_effect=None) @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): def test_run_compute(self, mock_host, mock_user, mock_path, mock_check, obj_with_exp_setup_compute, caplog):
obj = obj_with_exp_setup_compute.__next__()
assert obj_with_exp_setup_compute.__next__()._run() is None assert obj._run() is None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment