Close all positions on demo account when exiting tests

master
Mark Veidemanis 1 year ago
parent b8b39ea8d3
commit a6f9e74ee1
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -32,6 +32,11 @@ class ElasticMock:
class LiveBase:
@classmethod
def tearDownClass(cls):
cls.account.client.close_all_positions()
super(LiveBase, cls).tearDownClass()
@classmethod
def setUpClass(cls):
super(LiveBase, cls).setUpClass()

@ -78,3 +78,8 @@ class LiveTradingTestCase(ElasticMock, LiveBase, TestCase):
if not found:
self.fail("Could not find the trade in the list of open trades")
def test_convert_open_trades(self):
"""
Test converting open trades response to Trade-like format.
"""

Loading…
Cancel
Save