Skip to content

Commit b9660cf

Browse files
TST: fix slow tests
1 parent ea8b1ae commit b9660cf

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

tests/integration/test_environment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ def test_nam_atmosphere(mock_show, example_spaceport_env): # pylint: disable=un
160160
@pytest.mark.slow
161161
@patch("matplotlib.pyplot.show")
162162
def test_rap_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
163-
today = date.today()
164163
now = datetime.now(timezone.utc)
165-
example_spaceport_env.set_date((today.year, today.month, today.day, now.hour))
164+
example_spaceport_env.set_date((now.year, now.month, now.day, now.hour))
166165
example_spaceport_env.set_atmospheric_model(type="Forecast", file="RAP")
167166
assert example_spaceport_env.all_info() is None
168167

tests/integration/test_flight.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def test_liquid_motor_flight(mock_show, flight_calisto_liquid_modded): # pylint
228228

229229
@pytest.mark.slow
230230
@patch("matplotlib.pyplot.show")
231-
def test_time_overshoot(mock_show, calisto_robust, example_spaceport_env): # pylint: disable=unused-argument
231+
def test_time_overshoot_false(mock_show, calisto_robust, example_spaceport_env): # pylint: disable=unused-argument
232232
"""Test the time_overshoot parameter of the Flight class. This basically
233233
calls the all_info() method for a simulation without time_overshoot and
234234
checks if it returns None. It is not testing if the values are correct,
@@ -418,6 +418,19 @@ def test_air_brakes_flight(mock_show, flight_calisto_air_brakes): # pylint: dis
418418
assert air_brakes.prints.all() is None
419419

420420

421+
@patch("matplotlib.pyplot.show")
422+
def test_air_brakes_flight_with_overshoot(
423+
mock_show, flight_calisto_air_brakes_time_overshoot
424+
): # pylint: disable=unused-argument
425+
"""
426+
Same as test_air_brakes_flight but with time_overshoot=True.
427+
"""
428+
test_flight = flight_calisto_air_brakes_time_overshoot
429+
air_brakes = test_flight.rocket.air_brakes[0]
430+
assert air_brakes.plots.all() is None
431+
assert air_brakes.prints.all() is None
432+
433+
421434
@patch("matplotlib.pyplot.show")
422435
def test_initial_solution(mock_show, example_plain_env, calisto_robust): # pylint: disable=unused-argument
423436
"""Tests the initial_solution option of the Flight class. This test simply

tests/integration/test_plots.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def test_compare_flights(mock_show, mock_figure_show, calisto, example_plain_env
7474
)
7575

7676
calisto.set_rail_buttons(-0.5, 0.2)
77-
inclinations = [60, 70, 80, 90]
78-
headings = [0, 45, 90, 180]
77+
inclinations = [60, 90]
78+
headings = [0, 180]
7979
flights = []
80-
# Create (4 * 4) = 16 different flights to be compared
80+
# Create (2 * 2) = 4 different flights to be compared
8181
for heading in headings:
8282
for inclination in inclinations:
8383
flight = Flight(

0 commit comments

Comments
 (0)