From 9db8870dbcb30c4e46824d68ce2ea509084b8fd9 Mon Sep 17 00:00:00 2001 From: Joao-Dionisio Date: Tue, 12 Nov 2024 17:17:53 +0100 Subject: [PATCH] Restore optimized test --- tests/test_heur.py | 4 ++-- tests/test_memory.py | 6 +++++- tests/test_model.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_heur.py b/tests/test_heur.py index 9e9acd87f..454f11c74 100644 --- a/tests/test_heur.py +++ b/tests/test_heur.py @@ -4,7 +4,7 @@ import pytest from pyscipopt import Model, Heur, SCIP_RESULT, SCIP_PARAMSETTING, SCIP_HEURTIMING, SCIP_LPSOLSTAT -from pyscipopt.scip import is_memory_freed +from test_memory import is_optimized_mode from helpers.utils import random_mip_1 @@ -106,7 +106,7 @@ def test_heur(): assert round(sol[y]) == 0.0 def test_heur_memory(): - if is_memory_freed(): + if is_optimized_mode(): pytest.skip() def inner(): diff --git a/tests/test_memory.py b/tests/test_memory.py index a0c6d9363..f67a77f6a 100644 --- a/tests/test_memory.py +++ b/tests/test_memory.py @@ -15,4 +15,8 @@ def test_freed(): assert is_memory_freed() def test_print_memory_in_use(): - print_memory_in_use() \ No newline at end of file + print_memory_in_use() + +def is_optimized_mode(): + model = Model() + return is_memory_freed() \ No newline at end of file diff --git a/tests/test_model.py b/tests/test_model.py index f5dcd062a..800ae7ab8 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -3,6 +3,7 @@ import itertools from pyscipopt import Model, SCIP_STAGE, SCIP_PARAMSETTING, quicksum +from pyscipopt.scip import is_memory_freed def test_model(): # create solver instance