@@ -1262,39 +1262,43 @@ async def test_data_ignored_params(store: Store) -> None:
12621262 await create_array (store , data = data , shape = None , dtype = data .dtype , overwrite = True )
12631263
12641264 @staticmethod
1265- @pytest .mark .parametrize ("order_config" , ["C" , "F" , None ])
1265+ @pytest .mark .parametrize ("order" , ["C" , "F" , None ])
1266+ @pytest .mark .parametrize ("with_config" , [True , False ])
12661267 def test_order (
1267- order_config : MemoryOrder | None ,
1268+ order : MemoryOrder | None ,
1269+ with_config : bool ,
12681270 zarr_format : ZarrFormat ,
12691271 store : MemoryStore ,
12701272 ) -> None :
12711273 """
12721274 Test that the arrays generated by array indexing have a memory order defined by the config order
12731275 value, and that for zarr v2 arrays, the ``order`` field in the array metadata is set correctly.
12741276 """
1275- config : ArrayConfigLike = {}
1276- if order_config is None :
1277+ config : ArrayConfigLike | None = {}
1278+ if order is None :
12771279 config = {}
12781280 expected = zarr .config .get ("array.order" )
12791281 else :
1280- config = {"order" : order_config }
1281- expected = order_config
1282+ config = {"order" : order }
1283+ expected = order
1284+
1285+ if not with_config :
1286+ # Test without passing config parameter
1287+ config = None
1288+
1289+ arr = zarr .create_array (
1290+ store = store ,
1291+ shape = (2 , 2 ),
1292+ zarr_format = zarr_format ,
1293+ dtype = "i4" ,
1294+ order = order ,
1295+ config = config ,
1296+ )
1297+ assert arr .order == expected
12821298 if zarr_format == 2 :
1283- arr = zarr .create_array (
1284- store = store ,
1285- shape = (2 , 2 ),
1286- zarr_format = zarr_format ,
1287- dtype = "i4" ,
1288- order = expected ,
1289- config = config ,
1290- )
1291- # guard for type checking
12921299 assert arr .metadata .zarr_format == 2
12931300 assert arr .metadata .order == expected
1294- else :
1295- arr = zarr .create_array (
1296- store = store , shape = (2 , 2 ), zarr_format = zarr_format , dtype = "i4" , config = config
1297- )
1301+
12981302 vals = np .asarray (arr )
12991303 if expected == "C" :
13001304 assert vals .flags .c_contiguous
0 commit comments