Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored Jun 24, 2024
1 parent 8b266e9 commit 7b00324
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/plumpy/process_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ async def execute(self) -> State: # type: ignore # pylint: disable=invalid-over

def resume(self, value: Any = NULL) -> None:
assert self._waiting_future is not None, 'Not yet waiting'

if self._waiting_future.done():
return

self._waiting_future.set_result(value)


Expand Down
6 changes: 3 additions & 3 deletions test/test_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,15 @@ async def async_test():

# Now resume it
loaded_proc.resume()

loaded_proc.resume()

await loaded_proc.step_until_terminated()
self.assertEqual(loaded_proc.outputs, {'finished': True})

loop.create_task(proc.step_until_terminated())
loop.run_until_complete(async_test())

def test_wait_save_continue(self):
""" Test that process saved while in WAITING state restarts correctly when loaded """
loop = asyncio.get_event_loop()
Expand Down

0 comments on commit 7b00324

Please sign in to comment.