@@ -178,7 +178,7 @@ async def test_get_and_set_record(tmp_path: Path, key_value_store_client: KeyVal
178
178
assert bytes_record_info ['value' ].decode ('utf-8' ) == bytes_value .decode ('utf-8' )
179
179
180
180
# Test using file descriptor
181
- with open (os .path .join (tmp_path , 'test.json' ), 'w+' , encoding = 'utf-8' ) as f : # noqa: ASYNC101
181
+ with open (os .path .join (tmp_path , 'test.json' ), 'w+' , encoding = 'utf-8' ) as f : # noqa: ASYNC230
182
182
f .write ('Test' )
183
183
with pytest .raises (NotImplementedError , match = 'File-like values are not supported in local memory storage' ):
184
184
await key_value_store_client .set_record ('file' , f )
@@ -272,11 +272,11 @@ async def test_writes_correct_metadata(memory_storage_client: MemoryStorageClien
272
272
assert os .path .exists (item_path )
273
273
assert os .path .exists (metadata_path )
274
274
275
- with open (item_path , 'rb' ) as item_file : # noqa: ASYNC101
275
+ with open (item_path , 'rb' ) as item_file : # noqa: ASYNC230
276
276
actual_value = maybe_parse_body (item_file .read (), expected_output ['contentType' ])
277
277
assert actual_value == test_input ['value' ]
278
278
279
- with open (metadata_path , encoding = 'utf-8' ) as metadata_file : # noqa: ASYNC101
279
+ with open (metadata_path , encoding = 'utf-8' ) as metadata_file : # noqa: ASYNC230
280
280
metadata = json .load (metadata_file )
281
281
assert metadata ['key' ] == expected_output ['key' ]
282
282
assert expected_output ['contentType' ] in metadata ['contentType' ]
@@ -364,12 +364,12 @@ async def test_reads_correct_metadata(memory_storage_client: MemoryStorageClient
364
364
365
365
# Write the store metadata to disk
366
366
store_metadata_path = os .path .join (storage_path , '__metadata__.json' )
367
- with open (store_metadata_path , mode = 'wb' ) as store_metadata_file : # noqa: ASYNC101
367
+ with open (store_metadata_path , mode = 'wb' ) as store_metadata_file : # noqa: ASYNC230
368
368
store_metadata_file .write (json_dumps (store_metadata ).encode ('utf-8' ))
369
369
370
370
# Write the test input item to the disk
371
371
item_path = os .path .join (storage_path , test_input ['filename' ])
372
- with open (item_path , 'wb' ) as item_file : # noqa: ASYNC101
372
+ with open (item_path , 'wb' ) as item_file : # noqa: ASYNC230
373
373
if isinstance (test_input ['value' ], bytes ):
374
374
item_file .write (test_input ['value' ])
375
375
elif isinstance (test_input ['value' ], str ):
@@ -380,7 +380,7 @@ async def test_reads_correct_metadata(memory_storage_client: MemoryStorageClient
380
380
# Optionally write the metadata to disk if there is some
381
381
if test_input ['metadata' ] is not None :
382
382
metadata_path = os .path .join (storage_path , test_input ['filename' ] + '.__metadata__.json' )
383
- with open (metadata_path , 'w' , encoding = 'utf-8' ) as metadata_file : # noqa: ASYNC101
383
+ with open (metadata_path , 'w' , encoding = 'utf-8' ) as metadata_file : # noqa: ASYNC230
384
384
metadata_file .write (
385
385
json_dumps (
386
386
{
0 commit comments