Moves start api to test_api since it was the only place where it's used

This commit is contained in:
Sergi Delgado Segura
2019-11-14 15:40:02 +00:00
parent 1d1efc9ccf
commit f33d2d61ac
2 changed files with 18 additions and 16 deletions

View File

@@ -8,9 +8,7 @@ from hashlib import sha256
from binascii import unhexlify
from apps.cli.blob import Blob
from pisa.api import start_api
from pisa.responder import Job
from pisa.watcher import Watcher
from pisa.tools import bitcoin_cli
from pisa.db_manager import DBManager
from pisa.appointment import Appointment
@@ -29,18 +27,6 @@ def run_bitcoind():
sleep(0.1)
@pytest.fixture(scope="session")
def run_api(db_manager):
watcher = Watcher(db_manager)
api_thread = Thread(target=start_api, args=[watcher])
api_thread.daemon = True
api_thread.start()
# It takes a little bit of time to start the API (otherwise the requests are sent too early and they fail)
sleep(0.1)
@pytest.fixture(scope="session", autouse=True)
def prng_seed():
random.seed(0)