From 157af210b53a84d0bd07e8c7200023b6badd2727 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Wed, 25 Mar 2020 10:49:14 +0100 Subject: [PATCH] corrected test and removed unnecessary logging.error calls --- src/helpers.py | 3 --- src/run_modules/run_environment.py | 1 - test/test_data_handling/test_bootstraps.py | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/helpers.py b/src/helpers.py index 686d6a82..d108f3c3 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -82,7 +82,6 @@ class TimeTracking(object): self._end() else: msg = f"Time was already stopped {time.time() - self.end}s ago." - logging.error(msg) raise AssertionError(msg) if get_duration: return self.duration() @@ -117,7 +116,6 @@ def prepare_host(create_new=True, sampling="daily"): elif "runner-6HmDp9Qd-project-2411-concurrent" in hostname: path = f"/home/{user}/machinelearningtools/data/toar_{sampling}/" else: - logging.error(f"unknown host '{hostname}'") raise OSError(f"unknown host '{hostname}'") if not os.path.exists(path): try: @@ -127,7 +125,6 @@ def prepare_host(create_new=True, sampling="daily"): else: raise PermissionError except PermissionError: - logging.error(f"path '{path}' does not exist for host '{hostname}'.") raise NotADirectoryError(f"path '{path}' does not exist for host '{hostname}'.") else: logging.debug(f"set path to: {path}") diff --git a/src/run_modules/run_environment.py b/src/run_modules/run_environment.py index 04c984b1..7bd50277 100644 --- a/src/run_modules/run_environment.py +++ b/src/run_modules/run_environment.py @@ -63,7 +63,6 @@ class RunEnvironment(object): except (NameNotFoundInDataStore, FileNotFoundError): pass - @staticmethod def do_stuff(length=2): time.sleep(length) diff --git a/test/test_data_handling/test_bootstraps.py b/test/test_data_handling/test_bootstraps.py index 3c2cac10..27494ee9 100644 --- a/test/test_data_handling/test_bootstraps.py +++ b/test/test_data_handling/test_bootstraps.py @@ -106,7 +106,7 @@ class TestBootstrapGenerator: meta = boot_gen.get_bootstrap_meta_station_var_wise("DEBW107", "o3") labels = boot_gen.orig_generator.get_data_generator("DEBW107").get_transposed_label().shape[0] assert np.shape(meta) == (labels * boot_gen.number_of_boots, 2) - assert np.testing.assert_array_equal(np.unique(meta), ["DEBW107", "o3"]) + assert np.testing.assert_array_equal(np.unique(meta), ["DEBW107", "o3"]) is None def test_get_labels(self, boot_gen): res = [] -- GitLab