From 10b42e4a7c6449cbc6891cf887330c7ff109f16f Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 26 Jun 2024 15:58:26 -0400 Subject: [PATCH] Moving some slow tests to integration (#1442) --- idaes/apps/grid_integration/tests/test_integration.py | 2 +- idaes/core/surrogate/pysmo/tests/test_sampling.py | 6 +++--- .../unit_models/tests/test_heat_exchanger_1D.py | 2 +- .../unit_models/tests/test_FB1D.py | 2 +- .../tests/test_subcritical_flowsheets.py | 4 ++-- .../tests/test_fixed_bed_tsa0d_costing.py | 11 ++--------- 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/idaes/apps/grid_integration/tests/test_integration.py b/idaes/apps/grid_integration/tests/test_integration.py index e377f8c078..530a45b84d 100644 --- a/idaes/apps/grid_integration/tests/test_integration.py +++ b/idaes/apps/grid_integration/tests/test_integration.py @@ -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 ): diff --git a/idaes/core/surrogate/pysmo/tests/test_sampling.py b/idaes/core/surrogate/pysmo/tests/test_sampling.py index c104ea8d6e..d34851d34c 100644 --- a/idaes/core/surrogate/pysmo/tests/test_sampling.py +++ b/idaes/core/surrogate/pysmo/tests/test_sampling.py @@ -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 @@ -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 @@ -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 diff --git a/idaes/models/unit_models/tests/test_heat_exchanger_1D.py b/idaes/models/unit_models/tests/test_heat_exchanger_1D.py index 5a37d5bb76..b29bef8dd6 100644 --- a/idaes/models/unit_models/tests/test_heat_exchanger_1D.py +++ b/idaes/models/unit_models/tests/test_heat_exchanger_1D.py @@ -3547,7 +3547,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) diff --git a/idaes/models_extra/gas_solid_contactors/unit_models/tests/test_FB1D.py b/idaes/models_extra/gas_solid_contactors/unit_models/tests/test_FB1D.py index e21469b496..282aac1f9b 100644 --- a/idaes/models_extra/gas_solid_contactors/unit_models/tests/test_FB1D.py +++ b/idaes/models_extra/gas_solid_contactors/unit_models/tests/test_FB1D.py @@ -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) diff --git a/idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/tests/test_subcritical_flowsheets.py b/idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/tests/test_subcritical_flowsheets.py index 869a566b6a..1c5fc41b7c 100644 --- a/idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/tests/test_subcritical_flowsheets.py +++ b/idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/tests/test_subcritical_flowsheets.py @@ -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 @@ -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) diff --git a/idaes/models_extra/temperature_swing_adsorption/tests/test_fixed_bed_tsa0d_costing.py b/idaes/models_extra/temperature_swing_adsorption/tests/test_fixed_bed_tsa0d_costing.py index 8bbfff9b38..88039a2f3e 100644 --- a/idaes/models_extra/temperature_swing_adsorption/tests/test_fixed_bed_tsa0d_costing.py +++ b/idaes/models_extra/temperature_swing_adsorption/tests/test_fixed_bed_tsa0d_costing.py @@ -49,6 +49,7 @@ solver = get_solver() +@pytest.mark.integration class TestElectricBoilerCosting: @pytest.fixture(scope="class") def model(self): @@ -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") @@ -110,13 +110,11 @@ 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) @@ -124,7 +122,6 @@ def test_solve(self, model): @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( @@ -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): @@ -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") @@ -210,13 +206,11 @@ 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) @@ -224,7 +218,6 @@ def test_solve(self, model): @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(