From e4ca35cf0e2f526922738e89cd3b56d38248e7b6 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 1 Oct 2024 11:12:04 +1000 Subject: [PATCH] Move general use cube fixtures together. --- test/test_um2netcdf.py | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/test/test_um2netcdf.py b/test/test_um2netcdf.py index c009134..2d65999 100644 --- a/test/test_um2netcdf.py +++ b/test/test_um2netcdf.py @@ -86,6 +86,29 @@ def geo_potential_cube(lat_v_nd_coord, lon_u_nd_coord): return geo_potential +@pytest.fixture +def ua_plev_cube(): + return DummyCube(30201, "ua_plev") + + +@pytest.fixture +def heaviside_uv_cube(lat_v_nd_coord, lon_u_nd_coord): + return DummyCube(30301, "heaviside_uv", + coords=[lat_v_nd_coord, lon_u_nd_coord]) + + +@pytest.fixture +def ta_plev_cube(lat_v_nd_coord, lon_u_nd_coord): + return DummyCube(30204, "ta_plev", + coords=[lat_v_nd_coord, lon_u_nd_coord]) + + +@pytest.fixture +def heaviside_t_cube(lat_standard_eg_coord, lon_standard_eg_coord): + return DummyCube(30304, "heaviside_t", + coords=[lat_standard_eg_coord, lon_standard_eg_coord]) + + @pytest.fixture def std_args(): # TODO: make args namedtuple? @@ -379,29 +402,6 @@ def coord(self, _name): raise CoordinateNotFoundError(msg) -@pytest.fixture -def ua_plev_cube(): - return DummyCube(30201, "ua_plev") - - -@pytest.fixture -def heaviside_uv_cube(lat_v_nd_coord, lon_u_nd_coord): - return DummyCube(30301, "heaviside_uv", - coords=[lat_v_nd_coord, lon_u_nd_coord]) - - -@pytest.fixture -def ta_plev_cube(lat_v_nd_coord, lon_u_nd_coord): - return DummyCube(30204, "ta_plev", - coords=[lat_v_nd_coord, lon_u_nd_coord]) - - -@pytest.fixture -def heaviside_t_cube(lat_standard_eg_coord, lon_standard_eg_coord): - return DummyCube(30304, "heaviside_t", - coords=[lat_standard_eg_coord, lon_standard_eg_coord]) - - # cube filtering tests # NB: wrap results in tuples to capture generator output in sequences