mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 578 forks source link

Fix pytest_httpx test cases #1293

Open gsauthof opened 2 years ago

gsauthof commented 2 years ago

The new text keyword was introduced in pytest_httpx 0.14, deprecated in 0.14 and 0.17 and removed in 0.18.

Thus, an appropriate constraint to that dependency is added.

FWIW, this fixes the test cases on the upcoming Fedora 36 release.

See also:

romuald commented 1 year ago

Note that #1326 is doing the "same" fix, also changing the base async post method of httpx

kloczek commented 1 year ago

Tested that PR and looks like it fixed pytest failing uunits. I see however some pytest warnings as well

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-zeep-4.1.0-6.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-zeep-4.1.0-6.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.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-zeep-4.1.0, configfile: pyproject.toml, testpaths: tests
plugins: requests-mock-1.9.3, anyio-3.6.1, asyncio-0.19.0, httpx-0.21.0, hypothesis-6.41.0
asyncio: mode=strict
collected 486 items

tests/test_async_client.py .                                                                                                                                         [  0%]
tests/test_async_transport.py ......                                                                                                                                 [  1%]
tests/test_cache.py ............                                                                                                                                     [  3%]
tests/test_client.py ...............s....                                                                                                                            [  8%]
tests/test_client_factory.py .....                                                                                                                                   [  9%]
tests/test_helpers.py .....                                                                                                                                          [ 10%]
tests/test_loader.py ..                                                                                                                                              [ 10%]
tests/test_main.py ..                                                                                                                                                [ 10%]
tests/test_pprint.py ..                                                                                                                                              [ 11%]
tests/test_response.py .                                                                                                                                             [ 11%]
tests/test_settings.py ..                                                                                                                                            [ 11%]
tests/test_soap_multiref.py ..                                                                                                                                       [ 12%]
tests/test_soap_xop.py ...                                                                                                                                           [ 12%]
tests/test_transports.py ....s.                                                                                                                                      [ 14%]
tests/test_wsa.py .....                                                                                                                                              [ 15%]
tests/test_wsdl.py ....................                                                                                                                              [ 19%]
tests/test_wsdl_arrays.py .........                                                                                                                                  [ 21%]
tests/test_wsdl_messages_document.py ...................                                                                                                             [ 25%]
tests/test_wsdl_messages_http.py .......                                                                                                                             [ 26%]
tests/test_wsdl_messages_rpc.py .......                                                                                                                              [ 27%]
tests/test_wsdl_no_output_message_part.py .                                                                                                                          [ 28%]
tests/test_wsdl_soap.py ............                                                                                                                                 [ 30%]
tests/test_wsse_signature.py ...............                                                                                                                         [ 33%]
tests/test_wsse_username.py .......                                                                                                                                  [ 35%]
tests/test_wsse_utils.py .                                                                                                                                           [ 35%]
tests/test_xsd.py .................                                                                                                                                  [ 38%]
tests/test_xsd_any.py ..............                                                                                                                                 [ 41%]
tests/test_xsd_attributes.py ............                                                                                                                            [ 44%]
tests/test_xsd_builtins.py .............................................                                                                                             [ 53%]
tests/test_xsd_complex_types.py .........                                                                                                                            [ 55%]
tests/test_xsd_element.py .                                                                                                                                          [ 55%]
tests/test_xsd_extension.py ..............                                                                                                                           [ 58%]
tests/test_xsd_indicators_all.py ..                                                                                                                                  [ 58%]
tests/test_xsd_indicators_choice.py ...............................                                                                                                  [ 65%]
tests/test_xsd_indicators_group.py ............                                                                                                                      [ 67%]
tests/test_xsd_indicators_sequence.py .............                                                                                                                  [ 70%]
tests/test_xsd_integration.py ........................                                                                                                               [ 75%]
tests/test_xsd_parse.py ............                                                                                                                                 [ 77%]
tests/test_xsd_schemas.py ............................                                                                                                               [ 83%]
tests/test_xsd_signatures.py ........                                                                                                                                [ 85%]
tests/test_xsd_simple_types.py ......                                                                                                                                [ 86%]
tests/test_xsd_types.py ...............                                                                                                                              [ 89%]
tests/test_xsd_union.py ..                                                                                                                                           [ 89%]
tests/test_xsd_validation.py ..                                                                                                                                      [ 90%]
tests/test_xsd_valueobjects.py .....................                                                                                                                 [ 94%]
tests/test_xsd_visitor.py ......................                                                                                                                     [ 99%]
tests/integration/test_hello_world_recursive.py .                                                                                                                    [ 99%]
tests/integration/test_http_post.py ..                                                                                                                               [ 99%]
tests/integration/test_recursive_schema.py .                                                                                                                         [100%]

============================================================================= warnings summary =============================================================================
tests/conftest.py:19
  /home/tkloczko/rpmbuild/BUILD/python-zeep-4.1.0/tests/conftest.py:19: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    @pytest.yield_fixture()

tests/test_wsdl.py:162
  /home/tkloczko/rpmbuild/BUILD/python-zeep-4.1.0/tests/test_wsdl.py:162: DeprecationWarning: invalid escape sequence \-
    """

tests/test_xsd_union.py:50
  /home/tkloczko/rpmbuild/BUILD/python-zeep-4.1.0/tests/test_xsd_union.py:50: DeprecationWarning: invalid escape sequence \d
    """

tests/test_async_transport.py::test_no_cache
tests/test_async_transport.py::test_load
tests/test_async_transport.py::test_load_cache
tests/test_async_transport.py::test_post
tests/test_async_transport.py::test_session_close
tests/test_cache.py::TestSqliteCache::test_has_expired
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function Transport.__del__ at 0x7fce18742160>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILDROOT/python-zeep-4.1.0-6.fc35.x86_64/usr/lib/python3.8/site-packages/zeep/transports.py", line 159, in __del__
      if self.__close_session:
  AttributeError: 'AsyncTransport' object has no attribute '_Transport__close_session'

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

tests/test_async_transport.py::test_load_cache
  tests/test_async_transport.py:27: PytestWarning: The test <Function test_load_cache> 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.requests

tests/test_async_transport.py::test_post
  /usr/lib/python3.8/site-packages/httpx/_content.py:204: DeprecationWarning: Use 'content=<...>' to upload raw bytes/text content.
    warnings.warn(message, DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_client.py:154: test valid for windows platform only
SKIPPED [1] tests/test_transports.py:54: test valid for windows platform only
=============================================================== 484 passed, 2 skipped, 11 warnings in 2.84s ================================================================