Skip to content

Commit 6115b6d

Browse files
authored
Skipping slow tests on Mac and Windows on CI (#209)
* trying to skip slow tests on mac and windows on CI * fix CI logic * skip one more test
1 parent 1c3381b commit 6115b6d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# -*- coding: utf-8 -*-
22

3+
import os
4+
import sys
35
import numpy as np
46
import pytest
57
from fsps import StellarPopulation, filters
68
from numpy.testing import assert_allclose
79

10+
skip_slow_tests = pytest.mark.skipif(
11+
(sys.platform.startswith("win") or sys.platform.startswith("darwin"))
12+
and "CI" in os.environ,
13+
reason="Slow tests only run on Linux CI",
14+
)
15+
816

917
@pytest.fixture(scope="module")
1018
def pop_and_params():
@@ -19,6 +27,7 @@ def _reset_default_params(pop, params):
1927
pop.params[k] = params[k]
2028

2129

30+
@skip_slow_tests
2231
def test_isochrones(pop_and_params):
2332
"""Just test that `isochrones()` method runs"""
2433

@@ -30,6 +39,7 @@ def test_isochrones(pop_and_params):
3039
iso = pop.isochrones()
3140

3241

42+
@skip_slow_tests
3343
def test_imf3(pop_and_params):
3444
"""Make sure that changing the (upper) imf changes the parameter dirtiness
3545
and also the SSP spectrum"""
@@ -105,6 +115,7 @@ def test_smooth_lsf(pop_and_params):
105115
assert pop.params.dirtiness == 2
106116

107117

118+
@skip_slow_tests
108119
def test_tabular(pop_and_params):
109120
"""Test that you get the right shape spectral arrays for tabular SFHs, that
110121
the parameter dirtiness is appropriately managed for changing tabular SFH,
@@ -363,6 +374,7 @@ def test_smoothspec(pop_and_params):
363374
assert (spec - spec2 == 0.0).sum() > 0
364375

365376

377+
@skip_slow_tests
366378
def test_ssp_weights(pop_and_params):
367379
"""Check that weights dotted into ssp is the same as the returned spectrum
368380
when there's no dust or emission lines and zcontinuous=0"""

0 commit comments

Comments
 (0)