File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,17 +146,21 @@ def setUp(self):
146146 @add_key_examples
147147 def test_pickle_unpickle_cache (self , key ):
148148 zi = self .klass (key )
149- pkl_str = pickle .dumps (zi )
150- zi_rt = pickle .loads (pkl_str )
149+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
150+ with self .subTest (proto = proto ):
151+ pkl_str = pickle .dumps (zi , proto )
152+ zi_rt = pickle .loads (pkl_str )
151153
152154 self .assertIs (zi , zi_rt )
153155
154156 @hypothesis .given (key = valid_keys ())
155157 @add_key_examples
156158 def test_pickle_unpickle_no_cache (self , key ):
157159 zi = self .klass .no_cache (key )
158- pkl_str = pickle .dumps (zi )
159- zi_rt = pickle .loads (pkl_str )
160+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
161+ with self .subTest (proto = proto ):
162+ pkl_str = pickle .dumps (zi , proto )
163+ zi_rt = pickle .loads (pkl_str )
160164
161165 self .assertIsNot (zi , zi_rt )
162166 self .assertEqual (str (zi ), str (zi_rt ))
You can’t perform that action at this time.
0 commit comments