Skip to content

Commit

Permalink
Add back cleanup fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandpa committed Feb 16, 2023
1 parent ab6bba0 commit e62870c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions piker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import toml

from .log import get_logger

from tests.test_services import get_test_app_dir
log = get_logger('broker-config')

# taken from ``click`` since apparently they have some
Expand Down Expand Up @@ -78,7 +78,7 @@ def _posixify(name):
# within the tractor runtimes and store testing config data
# outside of the users filesystem
if "pytest" in sys.modules:
app_name += '/_testing'
return get_test_app_dir()

# if WIN:
if platform.system() == 'Windows':
Expand Down
8 changes: 4 additions & 4 deletions tests/test_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

log = get_logger(__name__)

@pytest.fixture
@pytest.fixture(scope="session")
def paper_cleanup():
yield
app_dir = get_app_dir('piker')
# if os.path.isfile(app_dir):
# rmtree(app_dir)
# assert not os.path.isfile(app_dir)
if os.path.isfile(app_dir):
rmtree(app_dir)
assert not os.path.isfile(app_dir)

def test_paper_trade(
open_test_pikerd: AsyncContextManager,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ async def main():
trio.run(main)

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]

0 comments on commit e62870c

Please sign in to comment.