@@ -155,10 +155,7 @@ def test_rollback_with_transaction(
155155 assert len (horizon ) == 0
156156
157157
158- @mark .parametrize (
159- "object" ,
160- ["bool" , "len" , "commit" ]
161- )
158+ @mark .parametrize ("object" , ["bool" , "len" , "commit" ])
162159def test_commit_with_transaction_without_transaction_effect (
163160 object : str ,
164161 horizon : Horizon ,
@@ -182,10 +179,7 @@ def test_commit_with_transaction_without_transaction_effect(
182179 assert commit == PreparedCommit (UUID (int = 1 ), set ())
183180
184181
185- @mark .parametrize (
186- "object" ,
187- ["bool" , "len" , "commit" ]
188- )
182+ @mark .parametrize ("object" , ["bool" , "len" , "commit" ])
189183def test_commit_completion_with_transaction_without_transaction_effect (
190184 object : str ,
191185 horizon : Horizon ,
@@ -210,10 +204,7 @@ def test_commit_completion_with_transaction_without_transaction_effect(
210204 assert commit == Commit (UUID (int = 1 ), set ())
211205
212206
213- @mark .parametrize (
214- "object" ,
215- ["bool" , "len" ]
216- )
207+ @mark .parametrize ("object" , ["bool" , "len" ])
217208def test_commit_completion_without_transaction (
218209 object : str ,
219210 horizon : Horizon ,
@@ -232,9 +223,7 @@ def test_commit_completion_without_transaction(
232223 assert len (horizon ) == 0
233224
234225
235- @mark .parametrize (
236- "object" , ["len" , "prepared_commit" , "completed_commit" ]
237- )
226+ @mark .parametrize ("object" , ["len" , "prepared_commit" , "completed_commit" ])
238227def test_commit_with_transaction_with_effect (
239228 object : str ,
240229 horizon : Horizon ,
@@ -247,10 +236,14 @@ def test_commit_with_transaction_with_effect(
247236 1 , UUID (int = 1 ), IsolationLevel .serializable_read_and_write
248237 )
249238
250- prepared_commit = horizon .commit_transaction (2 , UUID (int = 1 ), [
251- MutatedTuple (tuple_ (1 , "x" )),
252- NewTuple (tuple_ (1 , "y" )),
253- ])
239+ prepared_commit = horizon .commit_transaction (
240+ 2 ,
241+ UUID (int = 1 ),
242+ [
243+ MutatedTuple (tuple_ (1 , "x" )),
244+ NewTuple (tuple_ (1 , "y" )),
245+ ],
246+ )
254247 completed_commit = horizon .complete_commit (3 , prepared_commit .xid )
255248
256249 if object == "len" :
@@ -335,24 +328,24 @@ def test_with_sequential_transactions(
335328 horizon .start_transaction (
336329 1 , UUID (int = 1 ), IsolationLevel .serializable_read_and_write
337330 )
338- commit = horizon .commit_transaction (2 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))])
331+ commit = horizon .commit_transaction (
332+ 2 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))]
333+ )
339334 commit1 = horizon .complete_commit (3 , commit .xid )
340335
341336 horizon .start_transaction (
342337 4 , UUID (int = 2 ), IsolationLevel .serializable_read_and_write
343338 )
344- commit = horizon .commit_transaction (5 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))])
339+ commit = horizon .commit_transaction (
340+ 5 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))]
341+ )
345342 commit2 = horizon .complete_commit (6 , commit .xid )
346343
347344 if object == "commit1" :
348- assert commit1 == Commit (
349- UUID (int = 1 ), {MutatedTuple (tuple_ (1 , "a" ))}
350- )
345+ assert commit1 == Commit (UUID (int = 1 ), {MutatedTuple (tuple_ (1 , "a" ))})
351346
352347 if object == "commit2" :
353- assert commit2 == Commit (
354- UUID (int = 2 ), {MutatedTuple (tuple_ (1 , "b" ))}
355- )
348+ assert commit2 == Commit (UUID (int = 2 ), {MutatedTuple (tuple_ (1 , "b" ))})
356349
357350
358351@mark .parametrize (
@@ -376,19 +369,21 @@ def test_conflict_by_id_with_left_transaction(
376369 2 , UUID (int = 2 ), IsolationLevel .serializable_read_and_write
377370 )
378371
379- commit = horizon .commit_transaction (3 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))])
372+ commit = horizon .commit_transaction (
373+ 3 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))]
374+ )
380375 commit1 = horizon .complete_commit (4 , commit .xid )
381376
382377 conflict = None
383378 try :
384- horizon .commit_transaction (5 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))])
379+ horizon .commit_transaction (
380+ 5 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))]
381+ )
385382 except ConflictError as error :
386383 conflict = error
387384
388385 if object == "commit1" :
389- assert commit1 == Commit (
390- UUID (int = 1 ), {MutatedTuple (tuple_ (1 , "a" ))}
391- )
386+ assert commit1 == Commit (UUID (int = 1 ), {MutatedTuple (tuple_ (1 , "a" ))})
392387
393388 if object == "commit2" :
394389 assert conflict == ConflictError (UUID (int = 2 ), frozenset ())
@@ -415,22 +410,24 @@ def test_conflict_by_id_with_subset_transaction(
415410 2 , UUID (int = 2 ), IsolationLevel .serializable_read_and_write
416411 )
417412
418- commit2 = horizon .commit_transaction (3 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))])
413+ commit2 = horizon .commit_transaction (
414+ 3 , UUID (int = 2 ), [MutatedTuple (tuple_ (1 , "b" ))]
415+ )
419416 commit2 = horizon .complete_commit (4 , commit2 .xid )
420417
421418 commit1 = None
422419 try :
423- horizon .commit_transaction (5 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))])
420+ horizon .commit_transaction (
421+ 5 , UUID (int = 1 ), [MutatedTuple (tuple_ (1 , "a" ))]
422+ )
424423 except ConflictError as error :
425424 commit1 = error
426425
427426 if object == "commit1" :
428427 assert commit1 == ConflictError (UUID (int = 1 ), frozenset ())
429428
430429 if object == "commit2" :
431- assert commit2 == Commit (
432- UUID (int = 2 ), {MutatedTuple (tuple_ (1 , "b" ))}
433- )
430+ assert commit2 == Commit (UUID (int = 2 ), {MutatedTuple (tuple_ (1 , "b" ))})
434431
435432
436433@mark .parametrize (
@@ -468,10 +465,14 @@ def test_conflict_by_id_with_left_long_distance_transaction(
468465 3 , UUID (int = 3 ), IsolationLevel .serializable_read_and_write
469466 )
470467
471- commit = horizon .commit_transaction (4 , UUID (int = 2 ), [MutatedTuple (tuple_ ("y" ))])
468+ commit = horizon .commit_transaction (
469+ 4 , UUID (int = 2 ), [MutatedTuple (tuple_ ("y" ))]
470+ )
472471 commit2 = horizon .complete_commit (5 , commit .xid )
473472
474- commit = horizon .commit_transaction (6 , UUID (int = 1 ), [MutatedTuple (tuple_ ("x" ))])
473+ commit = horizon .commit_transaction (
474+ 6 , UUID (int = 1 ), [MutatedTuple (tuple_ ("x" ))]
475+ )
475476 commit1 = horizon .complete_commit (7 , commit .xid )
476477
477478 commit3 = None
@@ -481,14 +482,10 @@ def test_conflict_by_id_with_left_long_distance_transaction(
481482 commit3 = error
482483
483484 if object == "commit2" :
484- assert commit2 == Commit (
485- UUID (int = 2 ), {MutatedTuple (tuple_ ("y" ))}
486- )
485+ assert commit2 == Commit (UUID (int = 2 ), {MutatedTuple (tuple_ ("y" ))})
487486
488487 if object == "commit1" :
489- assert commit1 == Commit (
490- UUID (int = 1 ), {MutatedTuple (tuple_ ("x" ))}
491- )
488+ assert commit1 == Commit (UUID (int = 1 ), {MutatedTuple (tuple_ ("x" ))})
492489
493490 if object == "commit3" :
494491 assert commit3 == ConflictError (UUID (int = 3 ), frozenset ())
0 commit comments