Add python syntax check (#8651)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Add python syntax check * Fix some python regression algorithms * Fixing more bugs
This commit is contained in:
@@ -15,7 +15,7 @@ from AlgorithmImports import *
|
||||
from BasicTemplateIndexAlgorithm import BasicTemplateIndexAlgorithm
|
||||
|
||||
class BasicTemplateTradableIndexAlgorithm(BasicTemplateIndexAlgorithm):
|
||||
ticket = None
|
||||
ticket: OrderTicket | None = None
|
||||
def initialize(self) -> None:
|
||||
super().initialize()
|
||||
self.securities[self.spx].is_tradable = True
|
||||
@@ -26,5 +26,5 @@ class BasicTemplateTradableIndexAlgorithm(BasicTemplateIndexAlgorithm):
|
||||
self.ticket = self.market_order(self.spx, 1)
|
||||
|
||||
def on_end_of_algorithm(self) -> None:
|
||||
if self.ticket.status != OrderStatus.FILLED:
|
||||
raise Exception("Index is tradable.")
|
||||
if self.ticket and self.ticket.status != OrderStatus.FILLED:
|
||||
raise AssertionError("Index is tradable.")
|
||||
|
||||
Reference in New Issue
Block a user