From 3f1b7ff4be23b9a38585b5a189d816003f56160f Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (MBP)" Date: Mon, 15 Jan 2024 20:57:53 +0100 Subject: [PATCH] TST: fix test fixings_table_issue --- rateslib/legs.py | 2 +- tests/test_legs.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rateslib/legs.py b/rateslib/legs.py index 430f6d49..073c54ce 100644 --- a/rateslib/legs.py +++ b/rateslib/legs.py @@ -669,7 +669,7 @@ def _set_fixings( fixings_ = [] elif isinstance(fixings, Series): fixings_ = fixings.sort_index() - fixings_ = self._get_fixings_from_series(fixings) + fixings_ = self._get_fixings_from_series(fixings_) elif isinstance(fixings, tuple): fixings_ = [fixings[0]] + self._get_fixings_from_series(fixings[1], 1) elif not isinstance(fixings, list): diff --git a/tests/test_legs.py b/tests/test_legs.py index b2ff050b..be961612 100644 --- a/tests/test_legs.py +++ b/tests/test_legs.py @@ -238,7 +238,7 @@ def test_rfr_with_fixings_fixings_table_issue(self): id="estr", ) from rateslib import Solver - solver = Solver( + Solver( curves=[curve], instruments=instruments, s=[ @@ -293,7 +293,6 @@ def test_rfr_with_fixings_fixings_table_issue(self): fixed_rate=3.922, ) result = swap.leg2.fixings_table(curve) - expected = 1.0 assert result.loc[dt(2024, 1, 10), "notional"] == 0.0 assert abs(result.loc[dt(2024, 1, 11), "notional"] - 3006829846) < 1.0 assert abs(result.loc[dt(2023, 12, 20), "rates"] - 3.901) < 0.001