diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 90deea51d2a..87e5868b98a 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -86,6 +86,7 @@ dask_version = "10.0" ON_WINDOWS = sys.platform == "win32" +default_value = object() def open_example_dataset(name, *args, **kwargs): @@ -3604,11 +3605,21 @@ def create_tmp_geotiff( ny=3, nz=3, transform=None, - transform_args=[5000, 80000, 1000, 2000.0], - crs={"units": "m", "no_defs": True, "ellps": "WGS84", "proj": "utm", "zone": 18}, + transform_args=default_value, + crs=default_value, open_kwargs=None, additional_attrs=None, ): + if transform_args is default_value: + transform_args = [5000, 80000, 1000, 2000.0] + if crs is default_value: + crs = { + "units": "m", + "no_defs": True, + "ellps": "WGS84", + "proj": "utm", + "zone": 18, + } # yields a temporary geotiff file and a corresponding expected DataArray import rasterio from rasterio.transform import from_origin diff --git a/xarray/tests/test_conventions.py b/xarray/tests/test_conventions.py index acb2400ea04..a9c51b19c10 100644 --- a/xarray/tests/test_conventions.py +++ b/xarray/tests/test_conventions.py @@ -328,8 +328,12 @@ def create_store(self): @contextlib.contextmanager def roundtrip( - self, data, save_kwargs={}, open_kwargs={}, allow_cleanup_failure=False + self, data, save_kwargs=None, open_kwargs=None, allow_cleanup_failure=False ): + if save_kwargs is None: + save_kwargs = {} + if open_kwargs is None: + open_kwargs = {} store = CFEncodedInMemoryStore() data.dump_to_store(store, **save_kwargs) yield open_dataset(store, **open_kwargs)