Files
python-teos/test/unit/conftest.py
Sergi Delgado Segura 5f87705d26 Dissables can_connect_to_bitcoind with a non-running backend
Until a better way of handling the stop of bitcoind the test is dissabled, it created issues with other tests.
2019-10-14 16:57:58 +01:00

27 lines
718 B
Python

import pytest
from time import sleep
from threading import Thread
from pisa.api import start_api
from test.simulator.bitcoind_sim import run_simulator
@pytest.fixture(scope='session')
def run_bitcoind():
bitcoind_thread = Thread(target=run_simulator)
bitcoind_thread.daemon = True
bitcoind_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')
def run_api():
api_thread = Thread(target=start_api)
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)