Browse Source

tests: rm some redundant "electrum_path" temp dirs

master
SomberNight 2 years ago
parent
commit
dd3966070d
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/tests/test_storage_upgrade.py
  2. 6
      electrum/tests/test_wallet.py

5
electrum/tests/test_storage_upgrade.py

@ -319,14 +319,11 @@ class TestStorageUpgrade(WalletTestCase):
def setUp(self):
super().setUp()
self.__electrum_path = tempfile.mkdtemp()
config = SimpleConfig({'electrum_path': self.__electrum_path})
gui_name = 'cmdline'
# TODO it's probably wasteful to load all plugins... only need Trezor
self.plugins = Plugins(config, gui_name)
self.plugins = Plugins(self.config, gui_name)
def tearDown(self):
shutil.rmtree(self.__electrum_path)
self.plugins.stop()
self.plugins.stopped_event.wait()
super().tearDown()

6
electrum/tests/test_wallet.py

@ -36,10 +36,9 @@ class WalletTestCase(ElectrumTestCase):
def setUp(self):
super(WalletTestCase, self).setUp()
self.user_dir = tempfile.mkdtemp()
self.config = SimpleConfig({'electrum_path': self.user_dir})
self.config = SimpleConfig({'electrum_path': self.electrum_path})
self.wallet_path = os.path.join(self.user_dir, "somewallet")
self.wallet_path = os.path.join(self.electrum_path, "somewallet")
self._saved_stdout = sys.stdout
self._stdout_buffer = StringIO()
@ -47,7 +46,6 @@ class WalletTestCase(ElectrumTestCase):
def tearDown(self):
super(WalletTestCase, self).tearDown()
shutil.rmtree(self.user_dir)
# Restore the "real" stdout
sys.stdout = self._saved_stdout

Loading…
Cancel
Save