Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pytest_httpx test cases #1293

Closed
wants to merge 1 commit into from

Conversation

gsauthof
Copy link

@gsauthof gsauthof commented Feb 5, 2022

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:

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:
- https://github.com/Colin-b/pytest_httpx/blob/develop/CHANGELOG.md#0180---2022-01-17
- https://github.com/Colin-b/pytest_httpx/blob/develop/CHANGELOG.md#0140---2021-10-22
@romuald
Copy link
Contributor

romuald commented Aug 2, 2022

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

@kloczek
Copy link
Contributor

kloczek commented Aug 12, 2022

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 ================================================================

@mvantellingen
Copy link
Owner

Seems to be fixed in #1326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants