Skip to content

Commit

Permalink
replacing nose
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Meisrimel authored and Peter Meisrimel committed Mar 20, 2024
1 parent a22acc6 commit fd0e835
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_fmi_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def test_basic_simulation_none_result(self):
opts["step_size"] = 0.0005
res = master.simulate(options=opts)

assert res[models[0]]._result_data == None, "Result is not none"
assert res[models[1]]._result_data == None, "Result is not none"
assert res[models[0]]._result_data is None
assert res[models[1]]._result_data is None

def test_custom_result_handler_invalid(self):
models, connections = self._load_basic_simulation()
Expand All @@ -231,11 +231,14 @@ class A:

opts = {}
opts["result_handling"] = "hejhej"
nose.tools.assert_raises(Exception, self._sim_basic_simulation, models, connections, opts)
with pytest.raises(Exception):
self._sim_basic_simulation(models, connections, opts)
opts["result_handling"] = "custom"
nose.tools.assert_raises(Exception, self._sim_basic_simulation, models, connections, opts)
with pytest.raises(Exception):
self._sim_basic_simulation(models, connections, opts)
opts["result_handler"] = A()
nose.tools.assert_raises(Exception, self._sim_basic_simulation, models, connections, opts)
with pytest.raises(Exception):
self._sim_basic_simulation(models, connections, opts)

def test_custom_result_handler_valid(self):
models, connections = self._load_basic_simulation()
Expand Down

0 comments on commit fd0e835

Please sign in to comment.