diff --git a/tests/unit/preprocessor/_time/test_time.py b/tests/unit/preprocessor/_time/test_time.py index b478a97143..8cda75b73b 100644 --- a/tests/unit/preprocessor/_time/test_time.py +++ b/tests/unit/preprocessor/_time/test_time.py @@ -170,6 +170,13 @@ def test_extract_time_no_time(self): cube = _create_sample_cube()[0] sliced = extract_time(cube, 1950, 1, 1, 1950, 12, 31) assert cube == sliced + + def test_extract_time_none_year(self): + """Test extract_time when one of the years is None.""" + cube = self.cube.coord('time').guess_bounds() + with assert_raises(ValueError): + extract_time(cube, None, 1, 1, 1950, 2, 1) + class TestClipTimerange(tests.Test):