Brak opisu

conftest.py 412B

1234567891011121314151617181920
  1. try:
  2. from unittest.mock import AsyncMock
  3. except ImportError:
  4. # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence,
  5. # we need to resolve to a package on pypi.
  6. from asynctest import CoroutineMock as AsyncMock
  7. import pytest
  8. @pytest.fixture
  9. def connection():
  10. class Connection:
  11. pass
  12. connection = Connection()
  13. connection.send = AsyncMock()
  14. return connection