opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

Fix asyncio warnings/markers. #574

Closed dblock closed 10 months ago

dblock commented 10 months ago

Description

Fixes

test_opensearchpy/test_async/test_http_connection.py::TestAsyncHttpConnection::test_auth_as_tuple
  test_opensearchpy/test_async/test_http_connection.py:44: PytestWarning: The test <Function test_auth_as_tuple> 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_auth_as_tuple(self) -> None:

and

test_opensearchpy/test_async/test_plugins_client.py::TestPluginsClient::test_plugins_client
  /Users/dblock/.pyenv/versions/3.9.16/lib/python3.9/unittest/case.py:550: RuntimeWarning: coroutine 'TestPluginsClient.test_plugins_client' was never awaited
    method()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

I also added a codecov threshold of 0.1% to allow some minor coverage changes. In this PR there's no change in coverage, yet codecov seems to think otherwise because of some code line changes. No need to fail the build on such minor changes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 10 months ago

Codecov Report

Merging #574 (ad33580) into main (d8dc547) will increase coverage by 0.01%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #574      +/-   ##
==========================================
+ Coverage   71.69%   71.70%   +0.01%     
==========================================
  Files          87       87              
  Lines        7886     7886              
==========================================
+ Hits         5654     5655       +1     
+ Misses       2232     2231       -1     

see 1 file with indirect coverage changes