Skip to content

Commit

Permalink
test(backtest): set returns' paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Caceresenzo committed Jun 7, 2024
1 parent 05b86e1 commit 788976b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def assertDataFramesEqual(
self: unittest.TestCase,
first: pandas.DataFrame,
second: pandas.DataFrame,
atol=1.e-7
atol=1.e-8
) -> bool:
for index, column in enumerate(first.columns):
self.assertEqual(first.dtypes.iloc[index], second.dtypes.iloc[index], f"{column}: type mismatch between dataframes")
Expand Down
9 changes: 7 additions & 2 deletions tests/test_backtest_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ def test_yahoo_prices(self):

self.assertDataFramesEqual(
pandas.read_csv(fixture_path("yahoo/prices/dump.csv")),
pandas.read_csv("/tmp/dump.csv")
pandas.read_csv("/tmp/dump.csv"),
atol=1.e-7
)

self.assertDataFramesEqual(
pandas.read_csv(fixture_path("yahoo/prices/report.csv")),
pandas.read_csv("/tmp/report.csv")
pandas.read_csv("/tmp/report.csv"),
atol=1.e-7
)


Expand Down Expand Up @@ -171,9 +173,12 @@ def test_yahoo_returns(self):
exporters=[
ConsoleExporter(),
DumpExporter(
output_file="/tmp/dump.csv",
auto_override=True
),
QuantStatsExporter(
html_output_file='/tmp/report.html',
csv_output_file='/tmp/report.csv',
auto_override=True
),
],
Expand Down

0 comments on commit 788976b

Please sign in to comment.