Skip to content

Commit 7622138

Browse files
author
Menlo Innovations - CAVA Project
committed
Harrison 2381 - PMCL/TLAY - Run SWAPI test_calculate_pickup_ions_with_minimize if it has not been run in the last week
Requires regular manual updating of the LAST_RUN value to re-enable skipping
1 parent 0384ba2 commit 7622138

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/swapi/l3a/science/test_calculate_pickup_ion.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from datetime import datetime
1+
from datetime import datetime, timedelta
22
from datetime import datetime
33
from pathlib import Path
4-
from unittest import skip
4+
from unittest import skip, skipIf
55
from unittest.mock import patch, Mock
66

77
import numpy as np
@@ -464,7 +464,10 @@ def test_calculate_pui_temperature(self):
464464
fitting_params)
465465
self.assertAlmostEqual(24456817.05142866, result)
466466

467-
@skip
467+
LAST_RUN = datetime(2025, 3, 7)
468+
ALLOWED_GAP_TIME = timedelta(days=7)
469+
470+
@skipIf(datetime.now() < LAST_RUN + ALLOWED_GAP_TIME, "expensive test already run in last week")
468471
@patch("imap_processing.swapi.l3a.science.calculate_pickup_ion.spiceypy")
469472
def test_calculate_pickup_ions_with_minimize(self, mock_spice):
470473
ephemeris_time_for_epoch = 100000

0 commit comments

Comments
 (0)