Commit b96f652f authored by lukas leufen's avatar lukas leufen

better test cleanup

parent 766f8d04
Pipeline #43670 passed with stages
in 6 minutes and 7 seconds
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment