From 06cc3ac92cb0f7b5a4d3a60b39bef87e85db32ec Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 25 May 2023 18:04:52 -0400 Subject: [PATCH] Tidy up ems tests as per some `ruff`in --- tests/test_ems.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/test_ems.py b/tests/test_ems.py index 414bc906..8ee99807 100644 --- a/tests/test_ems.py +++ b/tests/test_ems.py @@ -50,16 +50,6 @@ from piker.accounting import ( log = get_logger(__name__) -async def open_pikerd( - open_test_pikerd: AsyncContextManager, - -) -> Services: - async with ( - open_test_pikerd() as (_, _, _, services), - ): - yield services - - async def order_and_and_wait_for_ppmsg( client: OrderClient, trades_stream: tractor.MsgStream, @@ -174,7 +164,7 @@ def test_ems_err_on_bad_broker( async def load_bad_fqme(): try: async with ( - open_test_pikerd() as (_, _, _, services), + open_test_pikerd() as (_, _, _, _), open_ems( 'doggycoin.doggy', @@ -268,7 +258,7 @@ async def submit_and_check( trades_stream, # tractor.MsgStream startup_pps, accounts, - dialogs, + _, # dialogs ) ): # no positions on startup @@ -370,7 +360,7 @@ def test_multi_fill_positions( nonlocal ppmsg, pos async with ( - open_test_pikerd() as (_, _, _, services), + open_test_pikerd() as (_, _, _, _), ): ppmsg, pos = await submit_and_check( fills=fills, @@ -385,19 +375,24 @@ def test_multi_fill_positions( # account (i.e. a user can expect to see paper pps persist across # runtime sessions. async def just_check_pp(): + nonlocal ppmsg + async with ( - open_test_pikerd() as (_, _, _, services), + open_test_pikerd() as (_, _, _, _), ): await match_ppmsgs_on_ems_boot([ppmsg]) run_and_tollerate_cancels(just_check_pp) +# TODO: still need to implement offline storage of darks/alerts/paper +# lives probably all the same way.. see +# https://github.com/pikers/piker/issues/463 def test_open_orders_reloaded( open_test_pikerd: AsyncContextManager, loglevel: str, - fills: tuple[dict], + # fills: tuple[dict], check_cross_session: bool = False, ):