================================================== test session starts ==================================================
platform win32 -- Python 3.8.5, pytest-6.2.4, py-1.11.0, pluggy-0.13.1 -- c:\dev\practicum\api_yatube\venv\scripts\python.exe
django: settings: yatube_api.settings (from ini)
rootdir: C:\DEV\practicum\api_yatube\api_yatube, configfile: pytest.ini, testpaths: tests/
plugins: django-4.4.0, pythonpath-0.7.3
collected 26 items
tests/test_auth.py::TestAuthAPI::test_auth <- ..\..\..\api_yatube\api_yatube\tests\test_auth.py PASSED [ 3%]
tests/test_comment.py::TestPostAPI::test_comments_not_found <- ..\..\..\api_yatube\api_yatube\tests\test_comment.py PASSED [ 7%]
tests/test_comment.py::TestPostAPI::test_comments_get_unauth <- ..\..\..\api_yatube\api_yatube\tests\test_comment.py PASSED [ 11%]
tests/test_comment.py::TestPostAPI::test_comments_get <- ..\..\..\api_yatube\api_yatube\tests\test_comment.py PASSED [ 15%]
tests/test_comment.py::TestPostAPI::test_comments_create <- ..\..\..\api_yatube\api_yatube\tests\test_comment.py PASSED [
19%]
def test_on_range():
assert get_stat(range(10), 3) == 2
def test_on_shuffled():
l=list(range(10))
random.shuffle(l)
assert get_stat(l,3) == 2
@pytest.fixture
def exp1():
print('basic options')
def exp2(exp1):
print('program code')
@pytest.mark.parametrize(
('value', 'state', expected), [
([1], 1, 1),
([1, 1, 1, 1], 4, 1),
(range(100), 4 ,3), ])
def test_on_range(value, state, expected):
assert func_state(value, state) == expected