Skip to content

Commit 760c248

Browse files
committed
Remove unnecessary prefixes from test names
Now that the tests for each part are in a separate file, we don't need to add prefixes to it, making the tests names shorter and less redundant in the logs. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent ab1af7f commit 760c248

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

tests/math/test_interval.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_invalid_range(start: LessThanComparable, end: LessThanComparable) -> No
6464
),
6565
],
6666
)
67-
def test_interval_contains( # pylint: disable=too-many-arguments
67+
def test_contains( # pylint: disable=too-many-arguments
6868
start: LessThanComparable,
6969
end: LessThanComparable,
7070
within: LessThanComparable,
@@ -94,7 +94,7 @@ def test_interval_contains( # pylint: disable=too-many-arguments
9494
),
9595
],
9696
)
97-
def test_interval_contains_no_start(
97+
def test_contains_no_start(
9898
end: LessThanComparable,
9999
within: LessThanComparable,
100100
at_end: LessThanComparable,
@@ -119,7 +119,7 @@ def test_interval_contains_no_start(
119119
),
120120
],
121121
)
122-
def test_interval_contains_no_end(
122+
def test_contains_no_end(
123123
start: LessThanComparable,
124124
within: LessThanComparable,
125125
at_start: LessThanComparable,
@@ -143,7 +143,7 @@ def test_interval_contains_no_end(
143143
CustomComparable(-10),
144144
],
145145
)
146-
def test_interval_contains_unbound(value: LessThanComparable) -> None:
146+
def test_contains_unbound(value: LessThanComparable) -> None:
147147
"""Test if a value is within the interval with no bounds."""
148148
interval_no_bounds: Interval[LessThanComparable | None] = Interval(
149149
start=None, end=None

tests/math/test_is_close_to_zero.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@
1212
# basic cases not working.
1313

1414

15-
def test_is_close_to_zero_default_tolerance() -> None:
15+
def test_default_tolerance() -> None:
1616
"""Test the is_close_to_zero function with the default tolerance."""
1717
assert is_close_to_zero(0.0)
1818
assert is_close_to_zero(1e-10)
1919
assert not is_close_to_zero(1e-8)
2020

2121

22-
def test_is_close_to_zero_custom_tolerance() -> None:
22+
def test_custom_tolerance() -> None:
2323
"""Test the is_close_to_zero function with a custom tolerance."""
2424
assert is_close_to_zero(0.0, abs_tol=1e-8)
2525
assert is_close_to_zero(1e-8, abs_tol=1e-8)
2626
assert not is_close_to_zero(1e-7, abs_tol=1e-8)
2727

2828

29-
def test_is_close_to_zero_negative_values() -> None:
29+
def test_negative_values() -> None:
3030
"""Test the is_close_to_zero function with negative values."""
3131
assert is_close_to_zero(-1e-10)
3232
assert not is_close_to_zero(-1e-8)
3333

3434

3535
@given(st.floats(allow_nan=False, allow_infinity=False))
36-
def test_is_close_to_zero_default_tolerance_hypothesis(value: float) -> None:
36+
def test_default_tolerance_hypothesis(value: float) -> None:
3737
"""Test the is_close_to_zero function with the default tolerance for many values."""
3838
if -1e-9 <= value <= 1e-9:
3939
assert is_close_to_zero(value)
@@ -45,9 +45,7 @@ def test_is_close_to_zero_default_tolerance_hypothesis(value: float) -> None:
4545
st.floats(allow_nan=False, allow_infinity=False),
4646
st.floats(allow_nan=False, allow_infinity=False, min_value=0.0, max_value=2.0),
4747
)
48-
def test_is_close_to_zero_custom_tolerance_hypothesis(
49-
value: float, abs_tol: float
50-
) -> None:
48+
def test_custom_tolerance_hypothesis(value: float, abs_tol: float) -> None:
5149
"""Test the is_close_to_zero function with a custom tolerance with many values/tolerance."""
5250
if -abs_tol <= value <= abs_tol:
5351
assert is_close_to_zero(value, abs_tol=abs_tol)

0 commit comments

Comments
 (0)