Make write on exit default false
parent
05fdc9dd60
commit
41f81eb701
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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]:
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue