Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ orbs:
steps:
- run:
no_output_timeout: 1.5h
command: tox -e <<parameters.tox_name>> <<parameters.tox_args>>
command: DS_RUN_SLOW_TESTS=true tox -e <<parameters.tox_name>> <<parameters.tox_args>>

tox_post:
steps:
Expand Down
52 changes: 51 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from pathlib import Path

from logbook import StderrHandler
Expand All @@ -6,6 +7,7 @@

from disc_solver.solve import solve
from disc_solver.float_handling import float_type as FLOAT_TYPE
from disc_solver.utils import str_to_bool

PLOT_FILE = "plot.png"

Expand Down Expand Up @@ -49,6 +51,7 @@
USE_E_R_SOLUTIONS = [
"mod_hydro_solution_use_E_r",
]

NON_APPROX_SOLUTIONS = [
"single_solution_default",
"sonic_root_solution_default",
Expand All @@ -57,6 +60,25 @@
"sonic_root_solution_no_internal",
]

CAN_BE_SKIPPED = {
"hydrostatic_solution_default",
"hydrostatic_solution_no_internal",
"mcmc_solution_no_internal",
"mod_hydro_solution_default",
"mod_hydro_solution_no_internal",
"mod_hydro_solution_use_E_r",
"sonic_root_solution_default",
"sonic_root_solution_no_internal",
}


@pytest.fixture(scope="session")
def skip_slow_tests():
dont_skip = os.environ.get("DS_RUN_SLOW_TESTS")
if dont_skip is None:
return True
return str_to_bool(dont_skip)


@pytest.fixture(scope="session")
def single_solution_default(tmpdir_factory):
Expand Down Expand Up @@ -181,37 +203,65 @@ def mod_hydro_solution_use_E_r(tmpdir_factory):


@pytest.fixture(scope="session", params=ALL_SOLUTIONS)
def solution(request):
def solution(request, skip_slow_tests):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=DEFAULT_SOLUTIONS)
def solution_default(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=NO_INTERNAL_SOLUTIONS)
def solution_no_internal(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=MULTI_SOLUTIONS)
def solutions_many(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=TAYLOR_SOLUTIONS)
def solution_taylor(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=DERIV_SOLUTIONS)
def solution_deriv(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


@pytest.fixture(scope="session", params=DERIV_NO_INTERNAL_SOLUTIONS)
def solution_deriv_no_internal(request):
if skip_slow_tests and request.param in CAN_BE_SKIPPED:
pytest.skip(
"Skipping as {} in skipable solutions".format(request.param)
)
return request.getfixturevalue(request.param)


Expand Down