Skip to content

Commit f110ebb

Browse files
πŸ“ PEP8-#201: Fix SIM117 nested with statements in test_engine
1 parent 2e293b7 commit f110ebb

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

β€Žtests/core/test_engine.pyβ€Ž

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,8 @@ def test_engine_timeout_context_no_timeout(self):
379379
task=task, workflow_id=self.workflow_id, previous_context=Context()
380380
)
381381

382-
with engine.start():
383-
with engine.timeout_context(seconds=0):
384-
engine.execute()
382+
with engine.start(), engine.timeout_context(seconds=0):
383+
engine.execute()
385384

386385
self.assertEqual(task.status, TypeStatus.COMPLETED)
387386

@@ -391,9 +390,8 @@ def test_engine_timeout_context_with_timeout(self):
391390
task=task, workflow_id=self.workflow_id, previous_context=Context()
392391
)
393392

394-
with engine.start():
395-
with engine.timeout_context(seconds=10):
396-
pass
393+
with engine.start(), engine.timeout_context(seconds=10):
394+
pass
397395

398396
self.assertEqual(task.status, TypeStatus.COMPLETED)
399397

@@ -403,9 +401,8 @@ def test_engine_checkpoint_context(self):
403401
task=task, workflow_id=self.workflow_id, previous_context=Context()
404402
)
405403

406-
with engine.start():
407-
with engine.checkpoint_context():
408-
engine.execute()
404+
with engine.start(), engine.checkpoint_context():
405+
engine.execute()
409406

410407
self.assertEqual(task.status, TypeStatus.COMPLETED)
411408
self.assertIsNotNone(task.current_context)

0 commit comments

Comments
Β (0)