diff --git a/pvnet_app/app.py b/pvnet_app/app.py index 5bc6b53..6250eb6 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -218,7 +218,8 @@ def app( # Store the config filename so we can create batches suitable for all models data_config_paths.append(data_config_path) else: - warnings.warn(f"The model {model_config.name} cannot be run with input data available") + message = f"The model {model_config.name} cannot be run with input data available" + warnings.warn(message) if len(forecast_compilers) == 0: raise Exception(f"No models were compatible with the available input data.") diff --git a/tests/conftest.py b/tests/conftest.py index 0194e15..8bca352 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,7 +20,7 @@ xr.set_options(keep_attrs=True) -@pytest.fixture() +@pytest.fixture(scope="module") def test_t0(): return pd.Timestamp.now(tz=None).floor(timedelta(minutes=30)) @@ -115,7 +115,7 @@ def make_nwp_data(shell_path, varname, test_t0): return ds -@pytest.fixture +@pytest.fixture(scope="module") def nwp_ukv_data(test_t0): return make_nwp_data( shell_path=f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp_ukv_shell.zarr", @@ -124,7 +124,7 @@ def nwp_ukv_data(test_t0): ) -@pytest.fixture +@pytest.fixture(scope="module") def nwp_ecmwf_data(test_t0): return make_nwp_data( shell_path=f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp_ecmwf_shell.zarr", @@ -168,20 +168,20 @@ def make_sat_data(test_t0, delay_mins, freq_mins): return ds -@pytest.fixture() +@pytest.fixture(scope="module") def sat_5_data(test_t0): return make_sat_data(test_t0, delay_mins=10, freq_mins=5) -@pytest.fixture() +@pytest.fixture(scope="module") def sat_5_data_zero_delay(test_t0): return make_sat_data(test_t0, delay_mins=0, freq_mins=5) -@pytest.fixture() +@pytest.fixture(scope="module") def sat_5_data_delayed(test_t0): return make_sat_data(test_t0, delay_mins=120, freq_mins=5) -@pytest.fixture() +@pytest.fixture(scope="module") def sat_15_data(test_t0): return make_sat_data(test_t0, delay_mins=0, freq_mins=15)