add generic test for logistics function fix2 #15

Open
jiamengwu wants to merge 5 commits from jiamengwu/2025-plovdiv-testing-debugging:logistic into main
Showing only changes of commit c11156fb80 - Show all commits

View file

@ -1,15 +1,11 @@
from numpy.testing import assert_allclose from numpy.testing import assert_allclose
import pytest
from logistic import f from logistic import f
def test_f_corner_cases(): @pytest.mark.parametrize('x,r,expected', [(0, 1.1, 0),(1, 3.7, 0)])
def test_f_corner_cases(x, r, expected):
# Test cases are (x, r, expected) # Test cases are (x, r, expected)
cases = [
(0, 1.1, 0),
(1, 3.7, 0),
]
for x, r, expected in cases:
result = f(x, r) result = f(x, r)
assert_allclose(result, expected) assert_allclose(result, expected)