From 579a9e07d19d94748f815859242b65e17b7071a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 18:06:40 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/boilercore_tests/conftest.py | 10 +++++----- tests/boilercore_tests/modelfun/conftest.py | 6 +++--- tests/boilercore_tests/modelfun/test_modelfun.py | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/boilercore_tests/conftest.py b/tests/boilercore_tests/conftest.py index 0f7de22..dfc3e22 100644 --- a/tests/boilercore_tests/conftest.py +++ b/tests/boilercore_tests/conftest.py @@ -27,13 +27,13 @@ def _filter_certain_warnings(): filter_boiler_warnings() -@pytest.fixture() +@pytest.fixture def project_session_path(tmp_path_factory) -> Path: """Project session path.""" return get_session_path(tmp_path_factory, boilercore) -@pytest.fixture() +@pytest.fixture def params(project_session_path): """Parameters.""" return Params(source=project_session_path / "params.yaml") @@ -47,7 +47,7 @@ def cache_dir(project_session_path) -> Path: return cache_directory -@pytest.fixture() +@pytest.fixture def cached_function_and_cache_file( request, project_session_path ) -> Iterator[tuple[Callable[..., Any], Path]]: @@ -76,11 +76,11 @@ def fun( (cache_dir / cache_filename).unlink(missing_ok=True) -@pytest.fixture() +@pytest.fixture def cached_function(cached_function_and_cache_file): # noqa: D103 return cached_function_and_cache_file[0] -@pytest.fixture() +@pytest.fixture def cache_file(cached_function_and_cache_file): # noqa: D103 return cached_function_and_cache_file[1] diff --git a/tests/boilercore_tests/modelfun/conftest.py b/tests/boilercore_tests/modelfun/conftest.py index cab7bb4..5db1895 100644 --- a/tests/boilercore_tests/modelfun/conftest.py +++ b/tests/boilercore_tests/modelfun/conftest.py @@ -12,19 +12,19 @@ MODELFUN = Path("src/boilercore/stages/modelfun.ipynb").resolve() -@pytest.fixture() +@pytest.fixture def ns(request) -> SimpleNamespace: """Namespace for the model function notebook.""" return get_nb_ns(MODELFUN.read_text(encoding="utf-8")) -@pytest.fixture() +@pytest.fixture def model(params): """Deserialized model.""" return FIT.get_models(params.paths.models)[1] -@pytest.fixture() +@pytest.fixture def plt(plt): """Plot.""" sns.set_theme( diff --git a/tests/boilercore_tests/modelfun/test_modelfun.py b/tests/boilercore_tests/modelfun/test_modelfun.py index 59b03f3..d1ac2c3 100644 --- a/tests/boilercore_tests/modelfun/test_modelfun.py +++ b/tests/boilercore_tests/modelfun/test_modelfun.py @@ -29,7 +29,7 @@ def test_syms(group_name: str): assert all(var == sym.name for var, sym in symvars.items()) -@pytest.mark.slow() +@pytest.mark.slow def test_forward_model(model): """Test that the model evaluates to the expected output for known input.""" # fmt: off @@ -54,7 +54,7 @@ def test_forward_model(model): # TODO: Add `nan` failed fit check -@pytest.mark.slow() +@pytest.mark.slow @pytest.mark.usefixtures("plt") @pytest.mark.parametrize( ("run", "y", "expected"), @@ -95,7 +95,7 @@ def test_model_fit(params, model, run, y, expected): assert result == approx(expected) -@pytest.mark.slow() +@pytest.mark.slow def test_ode(ns): """Verify the solution to the ODE by substitution.""" # Don't subs/simplify the lhs then try equating to zero. Doesn't work. "Truth value of @@ -104,14 +104,14 @@ def test_ode(ns): assert ode.subs(T(x), T_int_expr).simplify() -@pytest.mark.slow() +@pytest.mark.slow def test_temperature_continuous(ns): """Test that temperature is continuous at the domain transition.""" T_wa_expr_w, T_wa_expr_a = ns.T_wa_expr_w, ns.T_wa_expr_a # noqa: N806 assert Eq(T_wa_expr_w, T_wa_expr_a).simplify() -@pytest.mark.slow() +@pytest.mark.slow def test_temperature_gradient_continuous(ns): """Test that the temperature gradient is continuous at the domain transition.""" q_wa_expr_w, q_wa_expr_a = ns.q_wa_expr_w, ns.q_wa_expr_a