Skip to content
Snippets Groups Projects
Commit bae9ec83 authored by leufen1's avatar leufen1
Browse files

tests are updated, conftest shouldn't fail on teardown

parent 32a171f7
Branches
Tags
7 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!283Merge latest develop into falcos issue,!264Merge develop into felix_issue287_tech-wrf-datahandler-should-inherit-from-singlestationdatahandler,!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler",!258Lukas issue284 feat create fcn model class,!255Resolve "create FCN model class"
Pipeline #61097 passed
...@@ -58,10 +58,13 @@ def default_session_fixture(request): ...@@ -58,10 +58,13 @@ def default_session_fixture(request):
:type request: _pytest.python.SubRequest :type request: _pytest.python.SubRequest
:return: :return:
""" """
patched = mock.patch("multiprocessing.cpu_count", return_value=1) # patched = mock.patch("multiprocessing.cpu_count", return_value=1)
patched.__enter__() # patched.__enter__()
def unpatch(): # def unpatch():
patched.__exit__() # patched.__exit__()
request.addfinalizer(unpatch) # request.addfinalizer(unpatch)
with mock.patch("multiprocessing.cpu_count", return_value=1):
yield
...@@ -91,7 +91,7 @@ class TestFlattenTail: ...@@ -91,7 +91,7 @@ class TestFlattenTail:
assert final_dropout.rate == 0.35 assert final_dropout.rate == 0.35
inner_act = self.step_in(final_dropout) inner_act = self.step_in(final_dropout)
assert inner_act.get_config() == {'name': 'activation_1', 'trainable': True, 'activation': 'tanh'} assert inner_act.get_config() == {'name': 'activation_3', 'trainable': True, 'activation': 'tanh'}
inner_dense = self.step_in(inner_act) inner_dense = self.step_in(inner_act)
assert inner_dense.units == 64 assert inner_dense.units == 64
......
...@@ -103,8 +103,7 @@ class TestModelSetup: ...@@ -103,8 +103,7 @@ class TestModelSetup:
assert setup_with_gen.model is None assert setup_with_gen.model is None
setup_with_gen.build_model() setup_with_gen.build_model()
assert isinstance(setup_with_gen.model, AbstractModelClass) assert isinstance(setup_with_gen.model, AbstractModelClass)
expected = {"lr_decay", "model_name", "dropout_rate", "regularizer", "initial_lr", "optimizer", "activation", expected = {"lr_decay", "model_name", "optimizer", "activation", "input_shape", "output_shape"}
"input_shape", "output_shape"}
assert expected <= self.current_scope_as_set(setup_with_gen) assert expected <= self.current_scope_as_set(setup_with_gen)
def test_set_shapes(self, setup_with_gen_tiny): def test_set_shapes(self, setup_with_gen_tiny):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment