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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user