Add back cleanup fixture

paper_trade_improvements_rebase
algorandpa 2023-02-15 19:12:26 -05:00 committed by jaredgoldman
parent 43a68ef700
commit cf0b85aa51
3 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ from bidict import bidict
import toml import toml
from .log import get_logger from .log import get_logger
from tests.test_services import get_test_app_dir
log = get_logger('broker-config') log = get_logger('broker-config')
# taken from ``click`` since apparently they have some # taken from ``click`` since apparently they have some
@ -78,7 +78,7 @@ def get_app_dir(app_name, roaming=True, force_posix=False):
# within the tractor runtimes and store testing config data # within the tractor runtimes and store testing config data
# outside of the users filesystem # outside of the users filesystem
if "pytest" in sys.modules: if "pytest" in sys.modules:
app_name += '/_testing' return get_test_app_dir()
# if WIN: # if WIN:
if platform.system() == 'Windows': if platform.system() == 'Windows':

View File

@ -32,13 +32,13 @@ from exceptiongroup import BaseExceptionGroup
log = get_logger(__name__) log = get_logger(__name__)
@pytest.fixture @pytest.fixture(scope="session")
def paper_cleanup(): def paper_cleanup():
yield yield
app_dir = get_app_dir('piker') app_dir = get_app_dir('piker')
# if os.path.isfile(app_dir): if os.path.isfile(app_dir):
# rmtree(app_dir) rmtree(app_dir)
# assert not os.path.isfile(app_dir) assert not os.path.isfile(app_dir)
def test_paper_trade( def test_paper_trade(
open_test_pikerd: AsyncContextManager, open_test_pikerd: AsyncContextManager,

View File

@ -177,4 +177,4 @@ def test_ensure_ems_in_paper_actors(
trio.run(main) trio.run(main)
cancel_msg: str = '_emsd_main()` was remotely cancelled by its caller' cancel_msg: str = '_emsd_main()` was remotely cancelled by its caller'
assert cancel_msg in exc_info.value.args[0] assert cancel_msg in exc_info.value.args[0]