Unit tests
Simple unit test
import pytest
def test_some():
assert 1 == 1Async unit test
import pytest
@pytest.mark.asyncio
async def test_some():
assert 1 == 1Test exceptions
import pytest
def test_raise():
with pytest.raises(TypeError):
// do something that lead to the TypeError exception
... Запустить тест с набором параметров
Тест асинхронного запроса с асинхронным контекстом
Last updated