diff --git a/tests/fixtures/flight/flight_fixtures.py b/tests/fixtures/flight/flight_fixtures.py index c8fe437ca..f2afd3360 100644 --- a/tests/fixtures/flight/flight_fixtures.py +++ b/tests/fixtures/flight/flight_fixtures.py @@ -93,6 +93,22 @@ def flight_calisto_robust(calisto_robust, example_spaceport_env): ) +@pytest.fixture +def flight_calisto_robust_solid_eom(calisto_robust, example_spaceport_env): + """Similar to flight_calisto_robust, but with the equations of motion set to + "solid_propulsion". + """ + return Flight( + environment=example_spaceport_env, + rocket=calisto_robust, + rail_length=5.2, + inclination=85, + heading=0, + terminate_on_apogee=False, + equations_of_motion="solid_propulsion", + ) + + @pytest.fixture def flight_calisto_custom_wind(calisto_robust, example_spaceport_env): """A rocketpy.Flight object of the Calisto rocket. This uses the calisto diff --git a/tests/integration/test_flight.py b/tests/integration/test_flight.py index 5fdeb9c3d..aa6a02985 100644 --- a/tests/integration/test_flight.py +++ b/tests/integration/test_flight.py @@ -10,9 +10,12 @@ plt.rcParams.update({"figure.max_open_warning": 0}) +@pytest.mark.parametrize( + "flight_fixture", ["flight_calisto_robust", "flight_calisto_robust_solid_eom"] +) @patch("matplotlib.pyplot.show") # pylint: disable=unused-argument -def test_all_info(mock_show, flight_calisto_robust): +def test_all_info(mock_show, request, flight_fixture): """Test that the flight class is working as intended. This basically calls the all_info() method and checks if it returns None. It is not testing if the values are correct, but whether the method is working without errors. @@ -21,11 +24,13 @@ def test_all_info(mock_show, flight_calisto_robust): ---------- mock_show : unittest.mock.MagicMock Mock object to replace matplotlib.pyplot.show - flight_calisto_robust : rocketpy.Flight - Flight object to be tested. See the conftest.py file for more info - regarding this pytest fixture. + request : _pytest.fixtures.FixtureRequest + Request object to access the fixture dynamically. + flight_fixture : str + Name of the flight fixture to be tested. """ - assert flight_calisto_robust.all_info() is None + flight = request.getfixturevalue(flight_fixture) + assert flight.all_info() is None @pytest.mark.slow