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
@@ -61,25 +61,25 @@ class DescendingCustomDataObjectStoreRegressionAlgorithm(QCAlgorithm):
if slice.contains_key(self.custom_symbol):
custom_data = slice.get(SortCustomData, self.custom_symbol)
if custom_data.open == 0 or custom_data.high == 0 or custom_data.low == 0 or custom_data.close == 0 or custom_data.price == 0:
raise Exception("One or more custom data fields (open, high, low, close, price) are zero.")
raise AssertionError("One or more custom data fields (open, high, low, close, price) are 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")
# Make sure history requests work as expected
history = self.history(SortCustomData, self.custom_symbol, self.start_date, self.end_date, Resolution.DAILY)
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")
# Iterate through the history collection, checking if the time is in ascending order.
for i in range(len(history) - 1):
# [1] - time
if history.index[i][1] > history.index[i + 1][1]:
raise RegressionTestException(
raise AssertionError(
f"Order failure: {history.index[i][1]} > {history.index[i + 1][1]} at index {i}.")
def get_custom_data_key(self):