Closed kloczek closed 2 years ago
You're not installing our development dependencies, that's why you're seeing a warning.
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 =========================================================
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
Here is pytest output with current list of warnings:
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.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesHere is pytest output:
list of modules installed in build env: