plugin - Modifies conf when running tests to reduce running time

This commit is contained in:
Sergi Delgado Segura
2020-05-05 13:18:03 +02:00
parent ae4cea8aa2
commit cb4920b566

View File

@@ -1,4 +1,5 @@
import random
import configparser
from time import sleep
from coincurve import PrivateKey
from threading import Thread
@@ -78,8 +79,15 @@ def get_random_value_hex(nbytes):
@pytest.fixture(scope="session", autouse=True)
def towers_dict():
def init_tower():
os.environ["TOWERS_DATA_DIR"] = "/tmp/watchtower"
config = configparser.ConfigParser()
config["general"] = {"max_retries": "5"}
os.makedirs(os.environ["TOWERS_DATA_DIR"])
with open(os.path.join(os.environ["TOWERS_DATA_DIR"], "watchtower.conf"), "w") as configfile:
config.write(configfile)
yield