Skip to content

Commit

Permalink
coverage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Coull committed Apr 11, 2024
1 parent 5e34974 commit 2b71621
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/unit_tests/braket/timings/test_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@

@pytest.fixture
def default_values():
return [(2700, 25.1327), (300, 25.1327), (600, 15.1327), (Decimal(0.3), Decimal(0.4))]
return [
(2700, Decimal("25.1327")),
(300, Decimal("25.1327")),
(600, Decimal("15.1327")),
(Decimal("0.3"), Decimal("0.4")),
]


@pytest.fixture
Expand Down Expand Up @@ -265,11 +270,12 @@ def test_stitch_wrong_bndry_value():
@pytest.mark.parametrize(
"time_res, expected_times",
[
# default_time_series: [(Decimal(0.3), Decimal(0.4), (300, 25.1327), (600, 15.1327), (2700, 25.1327))] # noqa
(Decimal(0.5), [Decimal("0.5"), Decimal("300"), Decimal("600"), Decimal("2700")]),
(Decimal(1), [Decimal("0"), Decimal("300"), Decimal("600"), Decimal("2700")]),
(Decimal(200), [Decimal("0"), Decimal("400"), Decimal("600"), Decimal("2800")]),
(Decimal(1000), [Decimal("0"), Decimal("1000"), Decimal("3000")]),
# default_time_series: [(Decimal(0.3), Decimal(0.4)), (300, 25.1327), (600, 15.1327), (2700, 25.1327)] # noqa
(None, [Decimal("0.3"), Decimal("300"), Decimal("600"), Decimal("2700")]),
(Decimal("0.5"), [Decimal("0.5"), Decimal("300"), Decimal("600"), Decimal("2700")]),
(Decimal("1"), [Decimal("0"), Decimal("300"), Decimal("600"), Decimal("2700")]),
(Decimal("200"), [Decimal("0"), Decimal("400"), Decimal("600"), Decimal("2800")]),
(Decimal("1000"), [Decimal("0"), Decimal("1000"), Decimal("3000")]),
],
)
def test_discretize_times(default_time_series, time_res, expected_times):
Expand All @@ -280,7 +286,8 @@ def test_discretize_times(default_time_series, time_res, expected_times):
@pytest.mark.parametrize(
"value_res, expected_values",
[
# default_time_series: [(Decimal(0.3), Decimal(0.4), (300, 25.1327), (600, 15.1327), (2700, 25.1327))] # noqa
# default_time_series: [(Decimal(0.3), Decimal(0.4)), (300, 25.1327), (600, 15.1327), (2700, 25.1327)] # noqa
(None, [Decimal("0.4"), Decimal("25.1327"), Decimal("15.1327"), Decimal("25.1327")]),
(Decimal("0.1"), [Decimal("0.4"), Decimal("25.1"), Decimal("15.1"), Decimal("25.1")]),
(Decimal(1), [Decimal("0"), Decimal("25"), Decimal("15"), Decimal("25")]),
(Decimal(6), [Decimal("0"), Decimal("24"), Decimal("18"), Decimal("24")]),
Expand Down

0 comments on commit 2b71621

Please sign in to comment.