From 047a83044dede097d28444c1102d09bc077f367a Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Wed, 27 Nov 2024 15:14:18 +0100 Subject: [PATCH] test_inmemory.py / test_pickle.py --- test/persistence/test_inmemory.py | 10 ---------- test/persistence/test_pickle.py | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/test/persistence/test_inmemory.py b/test/persistence/test_inmemory.py index 3de2f890..ba661aad 100644 --- a/test/persistence/test_inmemory.py +++ b/test/persistence/test_inmemory.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import asyncio import unittest import plumpy @@ -13,16 +12,11 @@ def test_save_load_roundtrip(self): Test the plumpy.PicklePersister by taking a dummpy process, saving a checkpoint and recreating it from the same checkpoint """ - loop = asyncio.get_event_loop() process = ProcessWithCheckpoint() persister = plumpy.InMemoryPersister() persister.save_checkpoint(process) - bundle = persister.load_checkpoint(process.pid) - load_context = plumpy.LoadSaveContext(loop=loop) - recreated = bundle.unbundle(load_context) - def test_get_checkpoints_without_tags(self): """ """ process_a = ProcessWithCheckpoint() @@ -68,8 +62,6 @@ def test_get_process_checkpoints(self): checkpoint_a1 = plumpy.PersistedCheckpoint(process_a.pid, '1') checkpoint_a2 = plumpy.PersistedCheckpoint(process_a.pid, '2') - checkpoint_b1 = plumpy.PersistedCheckpoint(process_b.pid, '1') - checkpoint_b2 = plumpy.PersistedCheckpoint(process_b.pid, '2') checkpoints = [checkpoint_a1, checkpoint_a2] @@ -90,8 +82,6 @@ def test_delete_process_checkpoints(self): checkpoint_a1 = plumpy.PersistedCheckpoint(process_a.pid, '1') checkpoint_a2 = plumpy.PersistedCheckpoint(process_a.pid, '2') - checkpoint_b1 = plumpy.PersistedCheckpoint(process_b.pid, '1') - checkpoint_b2 = plumpy.PersistedCheckpoint(process_b.pid, '2') persister = plumpy.InMemoryPersister() persister.save_checkpoint(process_a, tag='1') diff --git a/test/persistence/test_pickle.py b/test/persistence/test_pickle.py index 0046792d..5c2b306a 100644 --- a/test/persistence/test_pickle.py +++ b/test/persistence/test_pickle.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import asyncio import tempfile import unittest @@ -17,17 +16,12 @@ def test_save_load_roundtrip(self): Test the plumpy.PicklePersister by taking a dummpy process, saving a checkpoint and recreating it from the same checkpoint """ - loop = asyncio.get_event_loop() process = ProcessWithCheckpoint() with tempfile.TemporaryDirectory() as directory: persister = plumpy.PicklePersister(directory) persister.save_checkpoint(process) - bundle = persister.load_checkpoint(process.pid) - load_context = plumpy.LoadSaveContext(loop=loop) - recreated = bundle.unbundle(load_context) - def test_get_checkpoints_without_tags(self): """ """ process_a = ProcessWithCheckpoint() @@ -75,8 +69,6 @@ def test_get_process_checkpoints(self): checkpoint_a1 = plumpy.PersistedCheckpoint(process_a.pid, '1') checkpoint_a2 = plumpy.PersistedCheckpoint(process_a.pid, '2') - checkpoint_b1 = plumpy.PersistedCheckpoint(process_b.pid, '1') - checkpoint_b2 = plumpy.PersistedCheckpoint(process_b.pid, '2') checkpoints = [checkpoint_a1, checkpoint_a2] @@ -98,8 +90,6 @@ def test_delete_process_checkpoints(self): checkpoint_a1 = plumpy.PersistedCheckpoint(process_a.pid, '1') checkpoint_a2 = plumpy.PersistedCheckpoint(process_a.pid, '2') - checkpoint_b1 = plumpy.PersistedCheckpoint(process_b.pid, '1') - checkpoint_b2 = plumpy.PersistedCheckpoint(process_b.pid, '2') with tempfile.TemporaryDirectory() as directory: persister = plumpy.PicklePersister(directory)