yandex / yandex-taxi-testsuite

testsuite: microservices testing framework
MIT License
144 stars 38 forks source link

Test examples don't pass from the box #3

Closed Kaveshnikov closed 2 years ago

Kaveshnikov commented 2 years ago

Hi! I have tried to run test examples for chat-backend and got exceptions.

Command to execute make runtests-chat-backend

Environment Python 3.7.10

Libraries | name | version | |--------------------|----------| | aiohttp | 3.8.0 | | aiosignal | 1.2.0 | | async-timeout | 4.0.0 | | asynctest | 0.13.0 | | attrs | 21.2.0 | | charset-normalizer | 2.0.7 | | frozenlist | 1.2.0 | | idna | 3.3 | | importlib-metadata | 4.8.1 | | iniconfig | 1.1.1 | | multidict | 5.2.0 | | packaging | 21.2 | | pip | 20.1.1 | | pluggy | 1.0.0 | | py | 1.10.0 | | pymongo | 3.12.1 | | pyparsing | 2.4.7 | | pytest | 6.2.5 | | python-dateutil | 2.8.2 | | pytz | 2021.3 | | PyYAML | 6.0 | | setuptools | 47.1.0 | | six | 1.16.0 | | toml | 0.10.2 | | typing-extensions | 3.10.0.2 | | uvloop | 0.16.0 | | yarl | 1.7.2 | | zipp | 3.6.0 |

Exceptions

Tests output ``` PYTHONPATH=../.. python3.7 -m pytest -vv chat-backend/tests ============================================================================================ test session starts ============================================================================================= platform linux -- Python 3.7.10, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /home/petrarca/.pyenv/versions/testsuite/bin/python3.7 cachedir: .pytest_cache rootdir: /home/petrarca/yandex-taxi-testsuite/docs/examples, configfile: pytest.ini collected 2 items chat-backend/tests/test_service.py::test_messages_send ERROR [ 50%] chat-backend/tests/test_service.py::test_messages_retrieve ERROR [100%] =================================================================================================== ERRORS =================================================================================================== ____________________________________________________________________________________ ERROR at setup of test_messages_send ____________________________________________________________________________________ _global_daemon_store = @pytest.fixture(scope='session') def register_daemon_scope(_global_daemon_store: _DaemonStore): """Context manager that registers service process session. Yields daemon scope instance. :param name: service name :spawn spawn: spawner function """ > return _global_daemon_store.scope E AttributeError: 'async_generator' object has no attribute 'scope' ../../testsuite/daemons/pytest_plugin.py:83: AttributeError __________________________________________________________________________________ ERROR at setup of test_messages_retrieve __________________________________________________________________________________ _global_daemon_store = @pytest.fixture(scope='session') def register_daemon_scope(_global_daemon_store: _DaemonStore): """Context manager that registers service process session. Yields daemon scope instance. :param name: service name :spawn spawn: spawner function """ > return _global_daemon_store.scope E AttributeError: 'async_generator' object has no attribute 'scope' ../../testsuite/daemons/pytest_plugin.py:83: AttributeError ========================================================================================== short test summary info =========================================================================================== ERROR chat-backend/tests/test_service.py::test_messages_send - AttributeError: 'async_generator' object has no attribute 'scope' ERROR chat-backend/tests/test_service.py::test_messages_retrieve - AttributeError: 'async_generator' object has no attribute 'scope' ============================================================================================= 2 errors in 0.09s ============================================================================================== Makefile:16: recipe for target 'runtests-chat-backend' failed make: *** [runtests-chat-backend] Error 1 ```
vitek commented 2 years ago

You are missing pytest-aiohttp dependency. You can also run tests inside docker container with make docker-runtests-chat-backend command.

Kaveshnikov commented 2 years ago

Yes, you are right. Tests passed after I installed pytest-aiohttp.