Make write on exit default false

explicit_write_pps_on_exit
jaredgoldman 2023-02-28 14:14:05 -05:00
parent 05fdc9dd60
commit 41f81eb701
4 changed files with 5 additions and 5 deletions

View File

@ -262,7 +262,7 @@ class PaperBoi(Struct):
with ( with (
open_trade_ledger(self.broker, 'paper') as ledger, open_trade_ledger(self.broker, 'paper') as ledger,
open_pps(self.broker, 'paper') as table open_pps(self.broker, 'paper', True) as table
): ):
ledger.update({oid: t.to_dict()}) ledger.update({oid: t.to_dict()})
# Write to pps toml right now # Write to pps toml right now
@ -530,7 +530,7 @@ async def trades_dialogue(
): ):
with open_pps(broker, 'paper', write_on_exit=False) as table: with open_pps(broker, 'paper') as table:
# save pps in local state # save pps in local state
_positions.update(table.pps) _positions.update(table.pps)

View File

@ -880,7 +880,7 @@ class PpsEncoder(toml.TomlEncoder):
def open_pps( def open_pps(
brokername: str, brokername: str,
acctid: str, acctid: str,
write_on_exit: bool = True, write_on_exit: bool = False,
) -> Generator[PpTable, None, None]: ) -> Generator[PpTable, None, None]:
''' '''

View File

@ -171,7 +171,7 @@ def open_test_pikerd_and_ems(
) )
@pytest.fixture(scope='session') @pytest.fixture(scope='module')
def delete_testing_dir(): def delete_testing_dir():
''' '''
This fixture removes the temp directory This fixture removes the temp directory

View File

@ -114,7 +114,7 @@ def _assert(
executions, executions,
): ):
with ( with (
open_pps(broker, account) as table, open_pps(broker, account, write_on_exit=False) as table,
): ):
''' '''
Assert multiple cases including pps, Assert multiple cases including pps,