@@ -282,9 +282,53 @@ ban-relative-imports = "all"
282
282
283
283
[tool .pytest .ini_options ]
284
284
addopts = [" --strict-config" , " --strict-markers" ]
285
+
286
+ # We want to forbid warnings from within xarray in our tests — instead we should
287
+ # fix our own code, or mark the test itself as expecting a warning. So this:
288
+ # - Converts any warning from xarray into an error
289
+ # - Allows some warnings ("default") which the test suite currently raises,
290
+ # since it wasn't practical to fix them all before merging this config. The
291
+ # arnings are still listed in CI (since it uses `default`, not `ignore`).
292
+ #
293
+ # We can remove these rules allowing warnings; a valued contribution is removing
294
+ # a line, seeing what breaks, and then fixing the library code or tests so that
295
+ # it doesn't raise warnings.
296
+ #
297
+ # While we only raise an error on warnings from within xarray, if dependency
298
+ # raises a warning with a stacklevel such that it's interpreted to be raised
299
+ # from xarray, please feel free to add a rule switching it to `default` here.
300
+ #
301
+ # If these settings get in the way of making progress, it's also acceptable to
302
+ # temporarily add additional ignores.
303
+
285
304
filterwarnings = [
286
- " ignore:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning" ,
305
+ " error:::xarray.*" ,
306
+ " default:No index created:UserWarning:xarray.core.dataset" ,
307
+ " default::UserWarning:xarray.tests.test_coding_times" ,
308
+ " default::UserWarning:xarray.tests.test_computation" ,
309
+ " default::UserWarning:xarray.tests.test_dataset" ,
310
+ " default:`ancestors` has been deprecated:DeprecationWarning:xarray.core.treenode" ,
311
+ " default:`iter_lineage` has been deprecated:DeprecationWarning:xarray.core.treenode" ,
312
+ " default:`lineage` has been deprecated:DeprecationWarning:xarray.core.treenode" ,
313
+ " default:coords should be an ndarray:DeprecationWarning:xarray.tests.test_variable" ,
314
+ " default:deallocating CachingFileManager:RuntimeWarning:xarray.backends.*" ,
315
+ " default:deallocating CachingFileManager:RuntimeWarning:xarray.backends.netCDF4_" ,
316
+ " default:deallocating CachingFileManager:RuntimeWarning:xarray.core.indexing" ,
317
+ " default:Failed to decode variable.*NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays:DeprecationWarning" ,
318
+ " default:dropping variables using `drop` is deprecated; use drop_vars:DeprecationWarning:xarray.tests.test_groupby" ,
319
+ " default:The `interpolation` argument to quantile was renamed to `method`:FutureWarning:xarray.*" ,
320
+ " default:invalid value encountered in cast:RuntimeWarning:xarray.core.duck_array_ops" ,
321
+ " default:invalid value encountered in cast:RuntimeWarning:xarray.conventions" ,
322
+ " default:invalid value encountered in cast:RuntimeWarning:xarray.tests.test_units" ,
323
+ " default:invalid value encountered in cast:RuntimeWarning:xarray.tests.test_array_api" ,
324
+ " default:NumPy will stop allowing conversion of:DeprecationWarning" ,
325
+ " default:shape should be provided:DeprecationWarning:xarray.tests.test_variable" ,
326
+ " default:the `pandas.MultiIndex` object:FutureWarning:xarray.tests.test_variable" ,
327
+ " default:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning" ,
328
+ " default:Duplicate dimension names present:UserWarning:xarray.namedarray.core" ,
329
+ " default:::xarray.tests.test_strategies" ,
287
330
]
331
+
288
332
log_cli_level = " INFO"
289
333
markers = [
290
334
" flaky: flaky tests" ,
0 commit comments