@@ -4555,13 +4555,12 @@ def __reduce__(self):
45554555 self .assertIn (expected , str (e ))
45564556
45574557 def fast_save_enter (self , create_data , minprotocol = 0 ):
4558- # gh-146059: Check that fast_save () is called when
4558+ # gh-146059: Check that fast_save_leave () is called when
45594559 # fast_save_enter() is called.
45604560 if not hasattr (self , "pickler" ):
45614561 self .skipTest ("need Pickler class" )
45624562
45634563 data = [create_data (i ) for i in range (FAST_NESTING_LIMIT * 2 )]
4564- data = {"key" : data }
45654564 protocols = range (minprotocol , pickle .HIGHEST_PROTOCOL + 1 )
45664565 for proto in protocols :
45674566 with self .subTest (proto = proto ):
@@ -4595,18 +4594,17 @@ def test_fast_save_enter_frozendict(self):
45954594 def test_fast_save_enter_dict (self ):
45964595 self .fast_save_enter (lambda i : {"key" : i })
45974596
4598- def deep_nested_struct (self , seed , create_nested ,
4597+ def deep_nested_struct (self , create_nested ,
45994598 minprotocol = 0 , compare_equal = True ,
46004599 depth = FAST_NESTING_LIMIT * 2 ):
4601- # gh-146059: Check that fast_save () is called when
4600+ # gh-146059: Check that fast_save_leave () is called when
46024601 # fast_save_enter() is called.
46034602 if not hasattr (self , "pickler" ):
46044603 self .skipTest ("need Pickler class" )
46054604
4606- data = seed
4605+ data = None
46074606 for i in range (depth ):
46084607 data = create_nested (data )
4609- data = {"key" : data }
46104608 protocols = range (minprotocol , pickle .HIGHEST_PROTOCOL + 1 )
46114609 for proto in protocols :
46124610 with self .subTest (proto = proto ):
@@ -4622,29 +4620,27 @@ def deep_nested_struct(self, seed, create_nested,
46224620 self .assertEqual (data2 , data )
46234621
46244622 def test_deep_nested_struct_tuple (self ):
4625- self .deep_nested_struct (( 1 ,), lambda data : (data ,))
4623+ self .deep_nested_struct (lambda data : (data ,))
46264624
46274625 def test_deep_nested_struct_list (self ):
4628- self .deep_nested_struct ([ 1 ], lambda data : [data ])
4626+ self .deep_nested_struct (lambda data : [data ])
46294627
46304628 def test_deep_nested_struct_frozenset (self ):
4631- self .deep_nested_struct (frozenset ((1 ,)),
4632- lambda data : frozenset ((1 , data )))
4629+ self .deep_nested_struct (lambda data : frozenset ((1 , data )))
46334630
46344631 def test_deep_nested_struct_set (self ):
4635- self .deep_nested_struct ({ 1 }, lambda data : {K (data )},
4632+ self .deep_nested_struct (lambda data : {K (data )},
46364633 depth = FAST_NESTING_LIMIT + 1 ,
46374634 compare_equal = False )
46384635
46394636 def test_deep_nested_struct_frozendict (self ):
46404637 if self .py_version < (3 , 15 ):
46414638 self .skipTest ('need frozendict' )
4642- self .deep_nested_struct (frozendict (x = 1 ),
4643- lambda data : frozendict (x = data ),
4639+ self .deep_nested_struct (lambda data : frozendict (x = data ),
46444640 minprotocol = 2 )
46454641
46464642 def test_deep_nested_struct_dict (self ):
4647- self .deep_nested_struct ({ 'x' : 1 }, lambda data : {'x' : data })
4643+ self .deep_nested_struct (lambda data : {'x' : data })
46484644
46494645
46504646class BigmemPickleTests :
0 commit comments