@@ -77,10 +77,7 @@ def test_empty():
7777 result = list (builder )
7878
7979 # then
80- assert len (result ) == 1
81- operation = result [0 ]
82- expected_update = UpdateRunSnapshot (timestamp = Timestamp (seconds = 1722341532 , nanos = 21934 ))
83- assert operation == expected_update
80+ assert len (result ) == 0
8481
8582
8683@freeze_time ("2024-07-30 12:12:12.000022" )
@@ -437,25 +434,26 @@ def test_split_large_tags():
437434 ]
438435
439436
440- @pytest .mark .parametrize ("action" , ( "raise" , "drop" ) )
437+ @pytest .mark .parametrize ("action" , [ "raise" , "drop" ] )
441438@pytest .mark .parametrize (
442439 "invalid_path" ,
443- ( None , "A" * 1025 , UTF_CHAR * 256 + "A" , object (), 1 , 1.0 , True , frozenset (), tuple (), datetime .now ()) ,
440+ [ None , "A" * 1025 , UTF_CHAR * 256 + "A" , object (), 1 , 1.0 , True , frozenset (), tuple (), datetime .now ()] ,
444441)
445- @pytest .mark .parametrize ("param_name" , ( "add_tags" , "remove_tags" , "configs" , "metrics" , "files" , "file_series" ) )
442+ @pytest .mark .parametrize ("param_name" , [ "add_tags" , "remove_tags" , "configs" , "metrics" , "files" , "file_series" ] )
446443def test_invalid_paths (caplog , action , invalid_path , param_name ):
447- data = {invalid_path : object ()}
448444 step = None
449445 kwargs = {name : None for name in ("add_tags" , "remove_tags" , "configs" , "metrics" , "files" , "file_series" )}
450446
451447 if param_name == "metrics" :
452- data = Metrics (data = data )
448+ data = Metrics (data = { invalid_path : 1 } )
453449 step = 1
454450 elif param_name == "files" :
455451 data = {invalid_path : FileRefData (destination = "x" , mime_type = "text/plain" , size_bytes = 0 )}
456452 elif param_name == "file_series" :
457453 data = {invalid_path : FileRefData (destination = "x" , mime_type = "text/plain" , size_bytes = 0 )}
458454 step = 1
455+ else :
456+ data = {invalid_path : "foo" }
459457
460458 kwargs [param_name ] = data
461459
@@ -470,10 +468,10 @@ def test_invalid_paths(caplog, action, invalid_path, param_name):
470468 with patch ("neptune_scale.sync.metadata_splitter.INVALID_VALUE_ACTION" , action ):
471469 if action == "raise" :
472470 with pytest .raises (NeptuneUnableToLogData , match = "paths must be" ):
473- next (splitter )
471+ list (splitter )
474472 else :
475473 with caplog .at_level ("WARNING" ):
476- next (splitter )
474+ list (splitter )
477475 assert "paths must be" in caplog .text
478476
479477
0 commit comments