Skip to content

Commit 1e4ef83

Browse files
authored
Fix failing history unit test (#8682)
* Fix failing unit test Add algorithm start date so period history request is consistent * Minor change
1 parent e416a54 commit 1e4ef83

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Tests/Research/QuantBookHistoryTests.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,14 +797,15 @@ public void HistoryDataDoesnNotReturnDataLabelWithBaseDataCollectionTypesAndPeri
797797
@"
798798
from AlgorithmImports import *
799799
800-
def getHistory():
800+
def get_history():
801801
qb = QuantBook()
802-
symbol = qb.AddEquity(""AAPL"", Resolution.Daily).symbol
803-
dataset_symbol = qb.AddData(FundamentalUniverse, symbol).symbol
804-
history = qb.History(dataset_symbol, 4015, Resolution.Daily)
802+
qb.set_start_date(2014, 4, 8)
803+
symbol = qb.add_equity(""AAPL"", Resolution.DAILY).symbol
804+
dataset_symbol = qb.add_data(FundamentalUniverse, symbol).symbol
805+
history = qb.history(dataset_symbol, 20, Resolution.DAILY)
805806
return history
806807
");
807-
dynamic getHistory = testModule.GetAttr("getHistory");
808+
dynamic getHistory = testModule.GetAttr("get_history");
808809
var pyHistory = getHistory() as PyObject;
809810
var isHistoryEmpty = pyHistory.GetAttr("empty").GetAndDispose<bool?>();
810811
Assert.IsFalse(isHistoryEmpty);

0 commit comments

Comments
 (0)