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

* Add python syntax check

* Fix some python regression algorithms

* Fixing more bugs
This commit is contained in:
Martin-Molinero
2025-03-28 10:36:26 -03:00
committed by GitHub
parent 581e87809b
commit 513ced31d7
155 changed files with 667 additions and 587 deletions
@@ -39,23 +39,23 @@ class CustomDataObjectStoreRegressionAlgorithm(QCAlgorithm):
if slice.contains_key(self.custom_symbol):
custom_data = slice.get(ExampleCustomData, self.custom_symbol)
if custom_data.price == 0:
raise Exception("Custom data price was not expected to be zero")
raise AssertionError("Custom data price was not expected to be zero")
self.received_data.append(custom_data)
def on_end_of_algorithm(self):
if not self.received_data:
raise Exception("Custom data was not fetched")
raise AssertionError("Custom data was not fetched")
custom_security = self.securities[self.custom_symbol]
if custom_security is None or custom_security.price == 0:
Exception("Expected the custom security to be added to the algorithm securities and to have a price that is not zero")
raise AssertionError("Expected the custom security to be added to the algorithm securities and to have a price that is not zero")
# Make sure history requests work as expected
history = self.history(ExampleCustomData, self.custom_symbol, self.start_date, self.end_date, Resolution.HOUR)
if history.shape[0] != len(self.received_data):
raise Exception("History request returned more or less data than expected")
raise AssertionError("History request returned more or less data than expected")
for i in range(len(self.received_data)):
received_data = self.received_data[i]
@@ -66,7 +66,7 @@ class CustomDataObjectStoreRegressionAlgorithm(QCAlgorithm):
history[["high"]].values[i][0] != received_data.high or
history[["low"]].values[i][0] != received_data.low or
history[["close"]].values[i][0] != received_data.close):
raise Exception("History request returned different data than expected")
raise AssertionError("History request returned different data than expected")
def get_custom_data_key(self):
return "CustomData/ExampleCustomData"