diff --git a/tests/test_io.py b/tests/test_io.py index bbb38211..bd0caeee 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1956,7 +1956,10 @@ def test_mixes_get_variable_s_data(self): def test_cpu_time(self): """ Verify the cumulative CPU time trajectory is never decreasing. """ - fmu = Dummy_FMUModelME2([], os.path.join(file_path, "files", "FMUs", "XML", "ME2.0", "bouncingBall.fmu"), _connect_dll=False) + fmu = Dummy_FMUModelME2( + [], + os.path.join(file_path, "files", "FMUs", "XML", "ME2.0", "bouncingBall.fmu"), _connect_dll=False + ) opts = fmu.simulate_options() opts['dynamic_diagnostics'] = True opts["result_file_name"] = "TestCPUTime.mat" @@ -1964,7 +1967,8 @@ def test_cpu_time(self): rdb = ResultDymolaBinary(opts["result_file_name"]) cpu_time = rdb.get_variable_data(f"{DIAGNOSTICS_PREFIX}cpu_time").x - + cpu_time_2, _ = rdb.get_variables_data([f"{DIAGNOSTICS_PREFIX}cpu_time"]) + cpu_time_2 = cpu_time_2[f"{DIAGNOSTICS_PREFIX}cpu_time"].x first_value = -1 # initialize to any negative value since the first cpu_time value is 0.0 # Test that the data is never decreasing (since we return it using numpy cumulative sum) @@ -1972,6 +1976,11 @@ def test_cpu_time(self): assert value >= first_value first_value = value + first_value = -1 + for value in cpu_time_2: + assert value >= first_value + first_value = value + @pytest.mark.assimulo class TestFileSizeLimit: def _setup(self, result_type, result_file_name="", fmi_type="me"):