qxf2 / qxf2-page-object-model

Write Selenium and Appium tests in Python using the Page Object pattern. This Pythonic GUI and API test automation framework will help you get started with QA automation quickly. It comes with many useful integrations like - email, BrowserStack, Slack, TestRail, etc. This repository is developed and maintained by Qxf2 Services.
https://qxf2.com
MIT License
256 stars 191 forks source link

Fix the API Async pytest marker #435

Closed shivahari closed 3 weeks ago

shivahari commented 3 weeks ago

The pytest-asyncio plugin requires the Asyncio tests to be marked - Asyncio.

Modify the test, replace the API marker on the Async API test with the right marker - @pytest.mark.asyncio

Using the wrong marker currently throws this warning:

tests/test_api_async_example.py::test_api_async_example
  /Users/foo/venv/pom_3_11/lib/python3.11/site-packages/_pytest/python.py:148: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
  You need to install a suitable plugin for your async framework, for example:
    - anyio
    - pytest-asyncio
    - pytest-tornasync
    - pytest-trio
    - pytest-twisted
    warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

even though the pytest-asyncio plugin is already installed

Name: pytest-asyncio
Version: 0.23.8
Summary: Pytest support for asyncio
Home-page: https://github.com/pytest-dev/pytest-asyncio
Author: Tin Tvrtković <tinchester@gmail.com>
Author-email: tinchester@gmail.com
License: Apache 2.0
Location: /Users/foo/venv/pom_3_11/lib/python3.11/site-packages
Requires: pytest
Required-by: