Closed hamedsh closed 3 years ago
Solution:
nest-asyncio
import nest_asyncio
import pytest
from main import calculator
nest_asyncio.apply()
@pytest.mark.asyncio async def test_calculator_sum(): expected = 5 subject = await calculator(2, 3) assert subject == expected
- add this line to engine section in `.pycrunc-config.yaml`: `load-pytest-plugins: true`
consider this function and test
this test will fail with the following error: