Skip to content

Commit

Permalink
move get_solver test to more natural location
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Oct 22, 2024
1 parent 74c6518 commit 9d6c7eb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
constraints_with_scale_factor_generator,
)
from idaes.core.util.model_statistics import number_activated_objectives
from watertap.core.solvers import get_solver
from watertap.core.plugins.solvers import IpoptWaterTAP, _pyomo_nl_writer_log

import watertap.core.plugins.solvers as solver_module
Expand Down Expand Up @@ -66,10 +65,6 @@ def s(self):
def test_pyomo_registration(self, s):
assert s.__class__ is IpoptWaterTAP

@pytest.mark.unit
def test_idaes_registration(self):
assert get_solver().__class__ is IpoptWaterTAP

@pytest.mark.unit
@pytest.mark.requires_idaes_solver
def test_attribute_passthrough(self, s):
Expand Down
21 changes: 21 additions & 0 deletions watertap/core/tests/test_solvers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#################################################################################
# WaterTAP Copyright (c) 2020-2024, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory,
# National Renewable Energy Laboratory, and National Energy Technology
# Laboratory (subject to receipt of any required approvals from the U.S. Dept.
# of Energy). All rights reserved.
#
# Please see the files COPYRIGHT.md and LICENSE.md for full copyright and license
# information, respectively. These files are also available online at the URL
# "https://github.com/watertap-org/watertap/"
#################################################################################


import pytest

from watertap.core.solvers import get_solver
from watertap.core.plugins.solvers import IpoptWaterTAP


def test_get_solver():
assert get_solver().__class__ is IpoptWaterTAP

0 comments on commit 9d6c7eb

Please sign in to comment.