From 8c568d1b2ae57d77348dccd685bdd86e80643679 Mon Sep 17 00:00:00 2001 From: algorandpa Date: Mon, 13 Feb 2023 11:01:02 -0500 Subject: [PATCH] Make config grab _testing dir in pytest env, - Remove print statements --- piker/clearing/_ems.py | 3 +-- piker/config.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/piker/clearing/_ems.py b/piker/clearing/_ems.py index 3af462a0..9895b533 100644 --- a/piker/clearing/_ems.py +++ b/piker/clearing/_ems.py @@ -1351,7 +1351,7 @@ async def maybe_open_trade_relays( loglevel, ) yield relay, feed, client_ready - print("ABOUT TO OPEN CACHED MNGR") + async with tractor.trionics.maybe_open_context( acm_func=cached_mngr, kwargs={ @@ -1365,7 +1365,6 @@ async def maybe_open_trade_relays( cache_hit, (relay, feed, client_ready) ): - print("YIELDING RELAY") yield relay, feed, client_ready diff --git a/piker/config.py b/piker/config.py index 59532eac..ff2f822f 100644 --- a/piker/config.py +++ b/piker/config.py @@ -71,10 +71,12 @@ def get_app_dir(app_name, roaming=True, force_posix=False): dot instead of the XDG config home or darwin's application support folder. """ - def _posixify(name): return "-".join(name.split()).lower() + if "pytest" in sys.modules: + app_name += '/_testing' + # if WIN: if platform.system() == 'Windows': key = "APPDATA" if roaming else "LOCALAPPDATA" @@ -94,7 +96,6 @@ def get_app_dir(app_name, roaming=True, force_posix=False): _posixify(app_name), ) - _config_dir = _click_config_dir = get_app_dir('piker') _parent_user = os.environ.get('SUDO_USER')