Skip to content

Commit

Permalink
Moving some slow tests to integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lee committed Jun 21, 2024
1 parent a66d4c4 commit 53fe9db
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion idaes/apps/grid_integration/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def self_scheduler_simulation_results_dir(
):
return self_scheduler_output_dir

@pytest.mark.unit
@pytest.mark.integration
def test_prescient_outputs_exist(
self, simulation_results_dir, self_scheduler_simulation_results_dir
):
Expand Down
6 changes: 3 additions & 3 deletions idaes/core/surrogate/pysmo/tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def test_sample_points_03(self, array_type):
)
np.testing.assert_array_equal(expected_testing, out_testing)

@pytest.mark.unit
@pytest.mark.integration
@pytest.mark.parametrize("array_type", [list])
def test_sample_points_equality_fixed_seed(self, array_type):
rand_seed = 1000
Expand Down Expand Up @@ -2707,7 +2707,7 @@ def test_sample_points_02(self, array_type):
unique_sample_points.shape,
)

@pytest.mark.unit
@pytest.mark.integration
@pytest.mark.parametrize("array_type", [list])
def test_sample_points_equality_fixed_seed(self, array_type):
rand_seed = 1000
Expand Down Expand Up @@ -3567,7 +3567,7 @@ def test_sample_points_with_numpy_array_input_selection_mode(self, array_type):
assert unique_sample_points.shape[1] == input_array.shape[1]
assert type(unique_sample_points) == np.ndarray

@pytest.mark.unit
@pytest.mark.integration
@pytest.mark.parametrize("array_type", [list])
def test_sample_points_equality_fixed_seed(self, array_type):
rand_seed = 1000
Expand Down
2 changes: 1 addition & 1 deletion idaes/models/unit_models/tests/test_heat_exchanger_1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ def model(self):

return m

@pytest.mark.component
@pytest.mark.integration
def test_general_hx1d_initializer(self, model):
initializer = HX1DInitializer()
initializer.initialize(model.fs.unit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ def iron_oc(self):

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
@pytest.mark.integration
def test_conservation(self, iron_oc):
# Calculate scaling factors
iscale.calculate_scaling_factors(iron_oc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_subc_power_plant():


@pytest.mark.skipif(not helmholtz_available(), reason="General Helmholtz not available")
@pytest.mark.component
@pytest.mark.integration
def test_dynamic_power_plant_build():
# constructing and initializing dynamic power plant
# not solving due to simulation time >20 min
Expand All @@ -164,7 +164,7 @@ def test_steadystate_power_plant_build():


@pytest.mark.skipif(not helmholtz_available(), reason="General Helmholtz not available")
@pytest.mark.component
@pytest.mark.integration
def test_dynamic_steam_cycle():
# constructing and initializing dynamic steam cycle flowsheet
m = steam_cycle.get_model(dynamic=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ def test_summary(self, model):
assert "Cycle time [h]" in summary_df.index
assert "Pressure drop [Pa]" in summary_df.index

@pytest.mark.unit
def test_plotting(self, model):
plot_tsa_profiles(model.fs.unit)


class TestTsaMgmof:
# also testing calculate beds and simple steam calcs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
solver = get_solver()


@pytest.mark.integration
class TestElectricBoilerCosting:
@pytest.fixture(scope="class")
def model(self):
Expand Down Expand Up @@ -97,7 +98,6 @@ def model(self):

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_build(self, model):
assert hasattr(model.fs, "costing")
assert hasattr(model.fs.costing, "total_TPC")
Expand All @@ -110,21 +110,18 @@ def test_build(self, model):

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_dof(self, model):
assert degrees_of_freedom(model) == 0

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_solve(self, model):
solver.options.bound_push = 1e-6
results = solver.solve(model)
assert check_optimal_termination(results)

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_solution(self, model):
# CO2 rich outlet
assert pytest.approx(79.1955, abs=1e-4) == value(
Expand All @@ -143,12 +140,12 @@ def test_solution(self, model):
@pytest.mark.ui
@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_report(self, model):
print_dac_costing(model.fs.unit)
dac_costing_summary(model.fs.unit)


@pytest.mark.integration
class TestRetrofitNgccCosting:
@pytest.fixture(scope="class")
def model(self):
Expand Down Expand Up @@ -197,7 +194,6 @@ def model(self):

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_build(self, model):
assert hasattr(model.fs, "costing")
assert hasattr(model.fs.costing, "total_TPC")
Expand All @@ -210,21 +206,18 @@ def test_build(self, model):

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_dof(self, model):
assert degrees_of_freedom(model) == 0

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_solve(self, model):
solver.options.bound_push = 1e-6
results = solver.solve(model)
assert check_optimal_termination(results)

@pytest.mark.solver
@pytest.mark.skipif(solver is None, reason="Solver not available")
@pytest.mark.component
def test_solution(self, model):
# CO2 rich outlet
assert pytest.approx(81.1308, abs=1e-4) == value(
Expand Down

0 comments on commit 53fe9db

Please sign in to comment.