OnWarmupFinished always called (#6413)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* OnWarmupFinished always called - Always call OnWarmupFinished. Adding regression tests * Assert method called with counter
This commit is contained in:
@@ -26,10 +26,11 @@ class OnWarmupFinishedRegressionAlgorithm(QCAlgorithm):
|
||||
|
||||
self.AddEquity("SPY", Resolution.Minute)
|
||||
self.SetWarmup(timedelta(days = 1))
|
||||
self._onWarmupFinished = 0
|
||||
|
||||
def OnWarmupFinished(self):
|
||||
self._onWarmupFinished = True
|
||||
self._onWarmupFinished += 1
|
||||
|
||||
def OnEndOfAlgorithm(self):
|
||||
if not self._onWarmupFinished:
|
||||
raise Exception('OnWarmupFinished was not called!')
|
||||
if self._onWarmupFinished != 1:
|
||||
raise Exception(f"Unexpected OnWarmupFinished call count {self._onWarmupFinished}")
|
||||
|
||||
Reference in New Issue
Block a user