elastic / elastic-transport-python

Transport classes and utilities shared among Python Elastic client libraries
https://elastic-transport-python.readthedocs.io
Apache License 2.0
20 stars 13 forks source link

8.1.2: pytest warnings #85

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.1.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.1.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2, configfile: setup.cfg
plugins: datadir-1.3.1, regressions-2.3.1, timeout-2.1.0, cov-3.0.0, httpserver-1.0.4
collected 404 items

tests/test_client_utils.py .............................................                                                                                             [ 11%]
tests/test_exceptions.py ....                                                                                                                                        [ 12%]
tests/test_httpbin.py ....                                                                                                                                           [ 13%]
tests/test_httpserver.py ..                                                                                                                                          [ 13%]
tests/test_logging.py ssssssssssss                                                                                                                                   [ 16%]
tests/test_models.py ........                                                                                                                                        [ 18%]
tests/test_node_pool.py ..................                                                                                                                           [ 23%]
tests/test_package.py .....                                                                                                                                          [ 24%]
tests/test_response.py ......................................................                                                                                        [ 37%]
tests/test_serializer.py .................                                                                                                                           [ 41%]
tests/test_transport.py .......................................                                                                                                      [ 51%]
tests/test_utils.py ..............                                                                                                                                   [ 54%]
tests/async_/test_async_transport.py sssss.sssssssssssss....ssssssssssssssss                                                                                         [ 64%]
tests/async_/test_httpbin.py ss                                                                                                                                      [ 65%]
tests/async_/test_httpserver.py s                                                                                                                                    [ 65%]
tests/node/test_base.py ......                                                                                                                                       [ 66%]
tests/node/test_http_aiohttp.py ssssssssssssssssssssss.s                                                                                                             [ 72%]
tests/node/test_http_requests.py ....................                                                                                                                [ 77%]
tests/node/test_http_urllib3.py ...............xx                                                                                                                    [ 81%]
tests/node/test_tls_versions.py ssssssssssssssssssssssssssssssssssssssssssssssssssssss.........                                                                      [ 97%]
tests/node/test_urllib3_chain_certs.py ssssssssss                                                                                                                    [100%]

============================================================================= warnings summary =============================================================================
tests/test_logging.py:34
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/test_logging.py:34: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/async_/test_async_transport.py:46
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/async_/test_async_transport.py:46: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/async_/test_httpbin.py:28
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/async_/test_httpbin.py:28: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/async_/test_httpserver.py:24
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/async_/test_httpserver.py:24: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/node/test_http_aiohttp.py:29
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/node/test_http_aiohttp.py:29: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/node/test_tls_versions.py:38
  /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2/tests/node/test_tls_versions.py:38: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.asyncio

tests/test_logging.py: 12 warnings
tests/async_/test_async_transport.py: 34 warnings
tests/async_/test_httpbin.py: 2 warnings
tests/async_/test_httpserver.py: 1 warning
tests/node/test_http_aiohttp.py: 23 warnings
tests/node/test_tls_versions.py: 54 warnings
  /usr/lib/python3.8/site-packages/_pytest/python.py:181: 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

---------- coverage: platform linux, python 3.8.13-final-0 -----------
Name                                              Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------------
elastic_transport/__init__.py                        30      6    80%   111-122
elastic_transport/_async_transport.py               139    107    23%   213-364, 372-378, 385-386, 392-403, 412-418, 422-454, 461-465
elastic_transport/_exceptions.py                     51      5    90%   80-82, 90, 115
elastic_transport/_models.py                        169     28    83%   40, 52, 55, 66-67, 100, 108-110, 128, 131-133, 136, 142, 164-165, 293-295, 302, 304, 306, 308, 326, 345, 351, 361
elastic_transport/_node/__init__.py                   6      0   100%
elastic_transport/_node/_base.py                    147     45    69%   147-149, 152-154, 157, 214-250, 263-264, 308, 316, 322
elastic_transport/_node/_base_async.py                7      0   100%
elastic_transport/_node/_http_aiohttp.py            119     65    45%   52-53, 79, 88-95, 104-107, 111, 113, 115, 117, 135-235, 241-243, 250-252, 272
elastic_transport/_node/_http_requests.py           107     18    83%   77-84, 121, 223-244
elastic_transport/_node/_http_urllib3.py             84     19    77%   64, 76-79, 97, 176-199
elastic_transport/_node/_urllib3_chain_certs.py      37     26    30%   33-122
elastic_transport/_node_pool.py                     138      7    95%   42, 83, 157, 218, 273, 277, 298
elastic_transport/_response.py                      115     13    89%   82, 95, 104, 107, 110, 120, 124, 134, 149, 153, 184, 199, 203
elastic_transport/_serializer.py                    107      9    92%   43, 46-47, 55, 103, 128-129, 138, 183
elastic_transport/_transport.py                     180     10    94%   203, 210, 304, 378-383, 391, 418-421
elastic_transport/_utils.py                          29      0   100%
elastic_transport/_version.py                         1      0   100%
elastic_transport/client_utils.py                    90      6    93%   72, 149, 167-168, 191-192
-------------------------------------------------------------------------------
TOTAL                                              1556    364    77%

========================================================================= short test summary info ==========================================================================
SKIPPED [126] ../../../../../usr/lib/python3.8/site-packages/_pytest/python.py:182: async def function and no async plugin installed (see warnings)
SKIPPED [2] tests/node/test_urllib3_chain_certs.py:31: Requires CPython 3.10+
SKIPPED [6] tests/node/test_urllib3_chain_certs.py:50: Requires CPython 3.10+
SKIPPED [2] tests/node/test_urllib3_chain_certs.py:76: Requires CPython 3.10+
XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_uncompressed_body_logged
XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_failed_request_logs
======================================================== 266 passed, 136 skipped, 2 xfailed, 132 warnings in 18.83s ========================================================

list of modules installed in build env:

Package                       Version
----------------------------- -----------------
aiohttp                       3.8.1
aiosignal                     1.2.0
alabaster                     0.7.12
apeye                         1.1.0
appdirs                       1.4.4
async-timeout                 4.0.2
attrs                         21.4.0
autodocsumm                   0.2.7
Babel                         2.9.1
beautifulsoup4                4.10.0
build                         0.7.0
CacheControl                  0.12.10
certifi                       2021.10.8
cffi                          1.15.0
charset-normalizer            2.0.12
click                         8.1.2
codespell                     2.1.0
coincidence                   0.6.1
consolekit                    1.3.1
coverage                      6.3.2
cryptography                  36.0.2
cssutils                      2.4.0
cycler                        0.11.0
Cython                        0.29.28
default-values                0.5.1
deprecation                   2.1.0
deprecation-alias             0.3.1
dict2css                      0.3.0
dist-meta                     0.3.4
distro                        1.7.0
docutils                      0.17.1
dom_toml                      0.5.1
domdf-python-tools            3.2.2.post1
extras                        1.0.0
first                         2.0.2
fixtures                      3.0.0
fonttools                     4.32.0
frozenlist                    1.3.0
gpg                           1.17.1-unknown
handy-archives                0.1.2
html-section                  0.2.0.post1
html2text                     2020.1.16
html5lib                      1.1
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.11.3
iniconfig                     1.1.1
Jinja2                        3.1.1
kiwisolver                    1.3.2
libcomps                      0.1.18
lockfile                      0.12.2
MarkupSafe                    2.1.1
matplotlib                    3.5.1
metaextract                   1.0.8
mistletoe                     0.8.2
mock                          4.0.3
msgpack                       1.0.3
multidict                     6.0.2
natsort                       8.0.2
numpy                         1.22.3
olefile                       0.46
packaging                     21.3
pbr                           5.8.1
pep517                        0.12.0
Pillow                        9.1.0
pip                           22.0.4
pluggy                        1.0.0
ply                           3.11
py                            1.11.0
py2pack                       0.8.7
pychoosealicense              0.3.0
pycparser                     2.21
Pygments                      2.11.2
PyGObject                     3.42.0
pyparsing                     3.0.8
pypi-json                     0.2.1
pypi-search                   1.2.1
pyproject-parser              0.4.2
pytest                        7.1.1
pytest-cov                    3.0.0
pytest-datadir                1.3.1
pytest-httpserver             1.0.4
pytest-regressions            2.3.1
pytest-timeout                2.1.0
python-dateutil               2.8.2
python-frontmatter            1.0.0
pytz                          2022.1
PyYAML                        6.0
requests                      2.27.1
rpm                           4.17.0
ruamel.yaml                   0.17.21
ruamel.yaml.clib              0.2.6
seed-intersphinx-mapping      1.0.1
setuptools                    62.0.0
shippinglabel                 1.0.1
six                           1.16.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        4.5.0.dev20220404
sphinx-autodoc-typehints      1.12.0
sphinx-copybutton             0.4.0
sphinx-debuginfo              0.2.2
sphinx-jinja2-compat          0.1.2
sphinx-licenseinfo            0.3.1
sphinx-notfound-page          0.8
sphinx-prompt                 1.4.0
sphinx-pyproject              0.1.0
sphinx-tabs                   3.3.1
sphinx-toolbox                2.18.0
sphinxcontrib-applehelp       1.0.2.dev20220410
sphinxcontrib-devhelp         1.0.2.dev20220410
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220410
sphinxcontrib-qthelp          1.0.3.dev20220410
sphinxcontrib-serializinghtml 1.1.5
sphinxemoji                   0.2.0
tabulate                      0.8.9
testtools                     2.5.0
toctree-plus                  0.6.0
toml                          0.10.2
tomli                         2.0.1
trove-classifiers             2022.4.11
trustme                       0.9.0
typing_extensions             4.1.1
urllib3                       1.26.9
webencodings                  0.5.1
Werkzeug                      2.1.1
wheel                         0.37.1
whey                          0.0.17
yarl                          1.7.2
zipp                          3.8.0
sethmlarson commented 2 years ago

You're not installing our development dependencies, that's why you're seeing a warning.

kloczek commented 2 years ago

Ups .. thakm you 😄 Indeed after add pytest-asyncio and pytest-mock now I have even more warnings 🤔

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.1.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.1.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.1.2, configfile: setup.cfg
plugins: httpserver-1.0.4, cov-3.0.0, asyncio-0.18.2, mock-3.7.0
asyncio: mode=legacy
collected 404 items

tests/test_client_utils.py .............................................                                                                                             [ 11%]
tests/test_exceptions.py ....                                                                                                                                        [ 12%]
tests/test_httpbin.py ....                                                                                                                                           [ 13%]
tests/test_httpserver.py ..                                                                                                                                          [ 13%]
tests/test_logging.py ............                                                                                                                                   [ 16%]
tests/test_models.py ........                                                                                                                                        [ 18%]
tests/test_node_pool.py ..................                                                                                                                           [ 23%]
tests/test_package.py .....                                                                                                                                          [ 24%]
tests/test_response.py ......................................................                                                                                        [ 37%]
tests/test_serializer.py .................                                                                                                                           [ 41%]
tests/test_transport.py .......................................                                                                                                      [ 51%]
tests/test_utils.py ..............                                                                                                                                   [ 54%]
tests/async_/test_async_transport.py .......................................                                                                                         [ 64%]
tests/async_/test_httpbin.py ..                                                                                                                                      [ 65%]
tests/async_/test_httpserver.py .                                                                                                                                    [ 65%]
tests/node/test_base.py ......                                                                                                                                       [ 66%]
tests/node/test_http_aiohttp.py ........................                                                                                                             [ 72%]
tests/node/test_http_requests.py ....................                                                                                                                [ 77%]
tests/node/test_http_urllib3.py ...............xx                                                                                                                    [ 81%]
tests/node/test_tls_versions.py ssssss......ssssss.............................................                                                                      [ 97%]
tests/node/test_urllib3_chain_certs.py ssssssssss                                                                                                                    [100%]

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191
  /usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

tests/async_/test_async_transport.py::test_kwargs_passed_on_to_node_pool
  tests/async_/test_async_transport.py:115: PytestWarning: The test <Function test_kwargs_passed_on_to_node_pool> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    def test_kwargs_passed_on_to_node_pool():

tests/async_/test_async_transport.py::test_transport_and_node_are_async[urllib3]
  tests/async_/test_async_transport.py:350: PytestWarning: The test <Function test_transport_and_node_are_async[urllib3]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @pytest.mark.parametrize(

tests/async_/test_async_transport.py::test_transport_and_node_are_async[requests]
  tests/async_/test_async_transport.py:350: PytestWarning: The test <Function test_transport_and_node_are_async[requests]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @pytest.mark.parametrize(

tests/async_/test_async_transport.py::test_transport_and_node_are_async[Urllib3HttpNode]
  tests/async_/test_async_transport.py:350: PytestWarning: The test <Function test_transport_and_node_are_async[Urllib3HttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @pytest.mark.parametrize(

tests/async_/test_async_transport.py::test_transport_and_node_are_async[RequestsHttpNode]
  tests/async_/test_async_transport.py:350: PytestWarning: The test <Function test_transport_and_node_are_async[RequestsHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @pytest.mark.parametrize(

tests/node/test_http_aiohttp.py::test_repr
  tests/node/test_http_aiohttp.py:368: PytestWarning: The test <Function test_repr> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    def test_repr():

tests/node/test_tls_versions.py::test_ssl_version_value_error[0-AiohttpHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[0-AiohttpHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[0-Urllib3HttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[0-Urllib3HttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[0-RequestsHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[0-RequestsHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-AiohttpHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[TLSv1-AiohttpHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-Urllib3HttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[TLSv1-Urllib3HttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-RequestsHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[TLSv1-RequestsHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-AiohttpHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[ssl_version2-AiohttpHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-Urllib3HttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[ssl_version2-Urllib3HttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-RequestsHttpNode]
  tests/node/test_tls_versions.py:124: PytestWarning: The test <Function test_ssl_version_value_error[ssl_version2-RequestsHttpNode]> is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'.
    @node_classes

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

---------- coverage: platform linux, python 3.8.13-final-0 -----------
Name                                              Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------------
elastic_transport/__init__.py                        30      0   100%
elastic_transport/_async_transport.py               139      8    94%   234, 314-319, 327, 354-357
elastic_transport/_exceptions.py                     51      3    94%   82, 90, 115
elastic_transport/_models.py                        169     26    85%   40, 52, 55, 66-67, 100, 108-110, 128, 131-133, 136, 142, 164-165, 294, 302, 304, 306, 308, 326, 345, 351, 361
elastic_transport/_node/__init__.py                   6      0   100%
elastic_transport/_node/_base.py                    147     18    88%   147-149, 152-154, 157, 223-224, 234-235, 242-243, 263-264, 308, 316, 322
elastic_transport/_node/_base_async.py                7      0   100%
elastic_transport/_node/_http_aiohttp.py            119     17    86%   52-53, 79, 88, 104-107, 111, 113, 115, 117, 196, 202, 208, 241-243
elastic_transport/_node/_http_requests.py           107      9    92%   77-84, 121, 224, 228, 234
elastic_transport/_node/_http_urllib3.py             84     10    88%   64, 76-79, 97, 177, 183, 188-191
elastic_transport/_node/_urllib3_chain_certs.py      37     26    30%   33-122
elastic_transport/_node_pool.py                     138      7    95%   42, 83, 157, 218, 273, 277, 298
elastic_transport/_response.py                      115     13    89%   82, 95, 104, 107, 110, 120, 124, 134, 149, 153, 184, 199, 203
elastic_transport/_serializer.py                    107      9    92%   43, 46-47, 55, 103, 128-129, 138, 183
elastic_transport/_transport.py                     180     10    94%   203, 210, 304, 378-383, 391, 418-421
elastic_transport/_utils.py                          29      0   100%
elastic_transport/_version.py                         1      0   100%
elastic_transport/client_utils.py                    90      6    93%   72, 149, 167-168, 191-192
-------------------------------------------------------------------------------
TOTAL                                              1556    162    90%

========================================================================= short test summary info ==========================================================================
SKIPPED [12] tests/node/test_tls_versions.py:102: TLSv1.1 isn't supported by this OpenSSL distribution
SKIPPED [2] tests/node/test_urllib3_chain_certs.py:31: Requires CPython 3.10+
SKIPPED [6] tests/node/test_urllib3_chain_certs.py:50: Requires CPython 3.10+
SKIPPED [2] tests/node/test_urllib3_chain_certs.py:76: Requires CPython 3.10+
XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_uncompressed_body_logged
XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_failed_request_logs
========================================================= 380 passed, 22 skipped, 2 xfailed, 16 warnings in 53.64s =========================================================
kloczek commented 2 years ago

Looks like first warning can b fixed by parch like below

--- a/pytest.ini~       2022-03-10 02:00:58.124461192 +0000
+++ b/pytest.ini        2022-03-10 02:00:45.499455769 +0000
@@ -0,0 +1,2 @@
+[pytest]
+asyncio_mode = auto
kloczek commented 2 years ago

Here is pytest output with current list of warnings:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.4.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-elastic-transport-8.4.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/elastic-transport-python-8.4.0, configfile: setup.cfg plugins: cov-3.0.0, asyncio-0.19.0, mock-3.8.2, httpserver-1.0.4 asyncio: mode=strict collected 408 items tests/test_client_utils.py ................................................. [ 12%] tests/test_exceptions.py .... [ 12%] tests/test_httpbin.py .... [ 13%] tests/test_httpserver.py .. [ 14%] tests/test_logging.py ............ [ 17%] tests/test_models.py ........ [ 19%] tests/test_node_pool.py .................. [ 23%] tests/test_package.py ..... [ 25%] tests/test_response.py ...................................................... [ 38%] tests/test_serializer.py ................. [ 42%] tests/test_transport.py ....................................... [ 51%] tests/test_utils.py .............. [ 55%] tests/async_/test_async_transport.py ....................................... [ 64%] tests/async_/test_httpbin.py .. [ 65%] tests/async_/test_httpserver.py . [ 65%] tests/node/test_base.py ...... [ 67%] tests/node/test_http_aiohttp.py ........................ [ 73%] tests/node/test_http_requests.py .................... [ 77%] tests/node/test_http_urllib3.py ...............xx [ 82%] tests/node/test_tls_versions.py ssssss......ssssss............................................. [ 97%] tests/node/test_urllib3_chain_certs.py ssssssssss [100%] ============================================================================= warnings summary ============================================================================= tests/async_/test_async_transport.py::test_kwargs_passed_on_to_node_pool tests/async_/test_async_transport.py:115: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. def test_kwargs_passed_on_to_node_pool(): tests/async_/test_async_transport.py::test_transport_and_node_are_async[urllib3] tests/async_/test_async_transport.py:350: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @pytest.mark.parametrize( tests/async_/test_async_transport.py::test_transport_and_node_are_async[requests] tests/async_/test_async_transport.py:350: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @pytest.mark.parametrize( tests/async_/test_async_transport.py::test_transport_and_node_are_async[Urllib3HttpNode] tests/async_/test_async_transport.py:350: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @pytest.mark.parametrize( tests/async_/test_async_transport.py::test_transport_and_node_are_async[RequestsHttpNode] tests/async_/test_async_transport.py:350: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @pytest.mark.parametrize( tests/node/test_http_aiohttp.py::test_repr tests/node/test_http_aiohttp.py:368: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. def test_repr(): tests/node/test_tls_versions.py::test_ssl_version_value_error[0-AiohttpHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[0-Urllib3HttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[0-RequestsHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-AiohttpHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-Urllib3HttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[TLSv1-RequestsHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-AiohttpHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-Urllib3HttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes tests/node/test_tls_versions.py::test_ssl_version_value_error[ssl_version2-RequestsHttpNode] tests/node/test_tls_versions.py:124: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove asyncio marker. If the test is not marked explicitly, check for global markers applied via 'pytestmark'. @node_classes -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [12] tests/node/test_tls_versions.py:102: TLSv1.1 isn't supported by this OpenSSL distribution SKIPPED [2] tests/node/test_urllib3_chain_certs.py:31: Requires CPython 3.10+ SKIPPED [6] tests/node/test_urllib3_chain_certs.py:50: Requires CPython 3.10+ SKIPPED [2] tests/node/test_urllib3_chain_certs.py:76: Requires CPython 3.10+ XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_uncompressed_body_logged XFAIL tests/node/test_http_urllib3.py::TestUrllib3HttpNode::test_failed_request_logs ========================================================= 384 passed, 22 skipped, 2 xfailed, 15 warnings in 44.56s ========================================================= ```