|
13 | 13 |
|
14 | 14 | import cf_units
|
15 | 15 | import numpy as np
|
| 16 | +import pytest |
16 | 17 |
|
17 | 18 | import iris
|
18 | 19 | import iris.analysis
|
@@ -240,14 +241,15 @@ def setUp(self):
|
240 | 241 |
|
241 | 242 | @tests.skip_data
|
242 | 243 | @tests.skip_plot
|
243 |
| -class Test1dScatter(tests.GraphicsTest): |
244 |
| - def setUp(self): |
245 |
| - super().setUp() |
| 244 | +class Test1dScatter: |
| 245 | + @pytest.fixture(autouse=True) |
| 246 | + def setup(self, check_graphic_caller): |
246 | 247 | self.cube = iris.load_cube(
|
247 | 248 | tests.get_data_path(("NAME", "NAMEIII_trajectory.txt")),
|
248 | 249 | "Temperature",
|
249 | 250 | )
|
250 | 251 | self.draw_method = iplt.scatter
|
| 252 | + self.check_graphic = check_graphic_caller |
251 | 253 |
|
252 | 254 | def test_coord_coord(self):
|
253 | 255 | x = self.cube.coord("longitude")
|
@@ -288,27 +290,6 @@ def test_cube_cube(self):
|
288 | 290 | self.draw_method(x, y, c=c, edgecolor="none")
|
289 | 291 | self.check_graphic()
|
290 | 292 |
|
291 |
| - def test_incompatible_objects(self): |
292 |
| - # cubes/coordinates of different sizes cannot be plotted |
293 |
| - x = self.cube |
294 |
| - y = self.cube.coord("altitude")[:-1] |
295 |
| - with self.assertRaises(ValueError): |
296 |
| - self.draw_method(x, y) |
297 |
| - |
298 |
| - def test_multidimensional(self): |
299 |
| - # multidimensional cubes/coordinates are not allowed |
300 |
| - x = _load_4d_testcube()[0, :, :, 0] |
301 |
| - y = x.coord("model_level_number") |
302 |
| - with self.assertRaises(ValueError): |
303 |
| - self.draw_method(x, y) |
304 |
| - |
305 |
| - def test_not_cube_or_coord(self): |
306 |
| - # inputs must be cubes or coordinates |
307 |
| - x = np.arange(self.cube.shape[0]) |
308 |
| - y = self.cube |
309 |
| - with self.assertRaises(TypeError): |
310 |
| - self.draw_method(x, y) |
311 |
| - |
312 | 293 |
|
313 | 294 | @tests.skip_data
|
314 | 295 | @tests.skip_plot
|
|
0 commit comments