Fixes memory leak bug regarding test db

This commit is contained in:
Sergi Delgado Segura
2019-11-14 15:04:55 +00:00
parent f65e2af675
commit ca3f6ee1b1
2 changed files with 16 additions and 5 deletions

View File

@@ -7,7 +7,6 @@ from threading import Thread
from hashlib import sha256
from binascii import unhexlify
from pisa.conf import DB_PATH
from apps.cli.blob import Blob
from pisa.api import start_api
from pisa.responder import Job
@@ -31,8 +30,7 @@ def run_bitcoind():
@pytest.fixture(scope="session")
def run_api():
db_manager = DBManager(DB_PATH)
def run_api(db_manager):
watcher = Watcher(db_manager)
api_thread = Thread(target=start_api, args=[watcher])
@@ -48,7 +46,7 @@ def prng_seed():
random.seed(0)
@pytest.fixture(scope="module")
@pytest.fixture(scope="session")
def db_manager():
manager = DBManager("test_db")
yield manager