diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py index 6e9445f7a..328cd9a39 100644 --- a/deluge/tests/test_torrent.py +++ b/deluge/tests/test_torrent.py @@ -37,14 +37,18 @@ class TorrentTestCase(BaseTestCase): def set_up(self): self.setup_config() - RPCServer(listen=False) + self.rpcserver = RPCServer(listen=False) self.core = Core() self.session = lt.session() self.torrent = None return component.start() def tear_down(self): - return component.shutdown() + def on_shutdown(result): + del self.rpcserver + del self.core + + return component.shutdown().addCallback(on_shutdown) def print_priority_list(self, priorities): tmp = '' diff --git a/deluge/tests/test_torrentmanager.py b/deluge/tests/test_torrentmanager.py index affbb751a..ea3b83f86 100644 --- a/deluge/tests/test_torrentmanager.py +++ b/deluge/tests/test_torrentmanager.py @@ -29,12 +29,17 @@ class TorrentmanagerTestCase(BaseTestCase): def set_up(self): common.set_tmp_config_dir() - RPCServer(listen=False) + self.rpcserver = RPCServer(listen=False) self.core = Core() return component.start() def tear_down(self): - return component.shutdown() + + def on_shutdown(result): + del self.rpcserver + del self.core + + return component.shutdown().addCallback(on_shutdown) @defer.inlineCallbacks def test_remove_torrent(self):