Allow running pybitmessage -t without tests package

This commit is contained in:
Dmitri Bogomolov 2020-10-22 13:23:11 +03:00
parent 8be89e9a25
commit 84b5f2982c
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -371,10 +371,14 @@ class Main(object):
self.stop() self.stop()
elif not state.enableGUI: elif not state.enableGUI:
state.enableGUI = True state.enableGUI = True
# pylint: disable=relative-import try:
from tests import core as test_core # pylint: disable=relative-import
from tests import core as test_core
except ImportError:
self.stop()
return
test_core_result = test_core.run() test_core_result = test_core.run()
state.enableGUI = True
self.stop() self.stop()
test_core.cleanup() test_core.cleanup()
sys.exit( sys.exit(