Skip to content

Commit 3f55d03

Browse files
committed
test: update tests for EfficientFrontierReb
1 parent d38ee5c commit 3f55d03

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def init_efficient_frontier_reb():
262262
ccy="USD",
263263
first_date="2019-01",
264264
last_date="2020-02",
265-
n_points=4,
265+
n_points=2,
266266
verbose=False,
267-
full_frontier=True,
267+
full_frontier=False,
268268
inflation=True,
269269
)

tests/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ python_files = test_*
55
python_classes = Test*
66
python_functions = test_*
77
xfail_strict = true
8-
addopts = -n auto
8+
addopts = -n auto -p no:warnings
99

1010
markers =
1111
smoke: All critical smoke tests

tests/test_frontier_reb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_repr(init_efficient_frontier_reb):
3737
def test_gmv_annual_weights(init_efficient_frontier_reb):
3838
assert_allclose(
3939
init_efficient_frontier_reb.gmv_annual_weights,
40-
np.array([0.384194, 0.615806]),
40+
np.array([0.447667, 0.552333]),
4141
rtol=1e-2,
4242
atol=1e-2,
4343
)
@@ -52,10 +52,10 @@ def test_gmv_annual_values(init_efficient_frontier_reb):
5252
@mark.rebalance
5353
@mark.frontier
5454
def test_max_return(init_efficient_frontier_reb):
55-
assert init_efficient_frontier_reb.global_max_return_portfolio["CAGR"] == approx(0.18899667, rel=1e-2)
55+
assert init_efficient_frontier_reb.global_max_return_portfolio["CAGR"] == approx(0.1623, abs=1e-2)
5656

5757

5858
@mark.rebalance
5959
@mark.frontier
6060
def test_ef_points_reb(init_efficient_frontier_reb):
61-
assert init_efficient_frontier_reb.ef_points["CAGR"].iloc[1] == approx(0.18241452, rel=1e-2)
61+
assert init_efficient_frontier_reb.ef_points["CAGR"].iloc[1] == approx(0.1623, abs=1e-2)

0 commit comments

Comments
 (0)