Skip to content

Commit 991bf85

Browse files
committed
Add tests for _round_seq and _round_sig_figs
1 parent b9234a6 commit 991bf85

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/cicd_utils/test_ridgeplot_examples.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import pytest
44

55
from ridgeplot_examples import ALL_EXAMPLES
6-
from ridgeplot_examples._base import _round_sig_figs # pyright: ignore[reportPrivateUsage]
6+
from ridgeplot_examples._base import (
7+
_round_nested_seq, # pyright: ignore[reportPrivateUsage]
8+
_round_seq, # pyright: ignore[reportPrivateUsage]
9+
_round_sig_figs, # pyright: ignore[reportPrivateUsage]
10+
)
711

812

913
def test_all_examples() -> None:
@@ -21,3 +25,11 @@ def test_all_examples() -> None:
2125
)
2226
def test_round_sig_figs(sig: int, x: float, expected: float) -> None:
2327
assert _round_sig_figs(x, sig) == expected
28+
29+
30+
def test_round_seq() -> None:
31+
assert _round_seq([123456, 123.456, 0.123456], 5) == [123460, 123.46, 0.12346]
32+
33+
34+
def test_round_nested_seq() -> None:
35+
assert _round_nested_seq([[123456], [123.456]], 5) == [[123460], [123.46]]

0 commit comments

Comments
 (0)