diff --git a/tests/test_asset.py b/tests/test_asset.py index 7d8ba6d..8eca19f 100644 --- a/tests/test_asset.py +++ b/tests/test_asset.py @@ -1,4 +1,5 @@ from pytest import mark +from pytest import approx import pandas as pd @@ -18,7 +19,7 @@ def test_close(init_asset_spy): def test_adj_close(init_asset_spy): - assert init_asset_spy.adj_close.loc['2000-01-20'] == 97.3802 + assert init_asset_spy.adj_close.loc['2000-01-20'] == approx(97.0629, rel=1e-2) def test_price(init_asset_spy): diff --git a/tests/test_asset_list.py b/tests/test_asset_list.py index 73e7eb9..e047b67 100644 --- a/tests/test_asset_list.py +++ b/tests/test_asset_list.py @@ -47,7 +47,8 @@ def test_ror(self): assert_frame_equal(self.asset_list_lt.assets_ror, asset_list_lt_sample) assert_frame_equal(self.currencies.assets_ror, currencies_sample) assert_frame_equal(self.real_estate.assets_ror, real_estate_sample) - assert_frame_equal(self.spy.assets_ror, spy_sample) + # SPY adj_close and ror is changing over time + assert_frame_equal(self.spy.assets_ror, spy_sample, rtol=1e-2) def test_currencies(self): assert self.currencies.pl.years == 1