cgtobi / PyRMVtransport

:bus: Get transport information from opendata.rmv.de
MIT License
12 stars 6 forks source link

Test failure #56

Closed fabaff closed 2 years ago

fabaff commented 2 years ago

The package build process on NixOS fails with pytest-httpx-0.17.3.

xecuting pytestCheckPhase
============================= test session starts ==============================
platform linux -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /build/source
plugins: asyncio-0.16.0, httpx-0.17.3, anyio-3.3.4
collected 15 items                                                             

tests/test_bugs.py FF                                                    [ 13%]
tests/test_rmvtransport.py FFxxxxFxxFFxF                                 [100%]

=================================== FAILURES ===================================
_______________________________ test_bug_3006907 _______________________________

xml = b''

    def extract_data_from_xml(xml: bytes) -> Any:
        """Extract data from xml."""
        retry = 0
        while retry < MAX_RETRIES:
            try:
>               return objectify.fromstring(xml)

RMVtransport/rmvtransport.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[...]
self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7ffff5421130>
request = <Request('GET', 'https://www.rmv.de/auskunft/bin/jp/ajax-getstop.exe/dn')>

    def _handle_request(
        self,
        request: httpx.Request,
    ) -> httpx.Response:
        self._requests.append(request)

        response = self._get_response(request)
        if not response:
            callback = self._get_callback(request)
            if callback:
>               response = callback(request)
E               TypeError: raise_timeout() missing 1 required positional argument: 'extensions'

/nix/store/p44zk6f7in6z2r60qjgv0sdq295mzjr9-python3.9-pytest-httpx-0.17.3/lib/python3.9/site-packages/pytest_httpx/_httpx_mock.py:194: TypeError
=============================== warnings summary ===============================
tests/test_bugs.py: 2 warnings
tests/test_rmvtransport.py: 12 warnings
  /build/source/RMVtransport/rmvtransport.py:151: DeprecationWarning: with timeout() is deprecated, use async with timeout() instead
    with async_timeout.timeout(self._timeout):

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_bugs.py::test_bug_3006907 - RMVtransport.errors.RMVtranspor...
FAILED tests/test_bugs.py::test_bug_request_bad_product - RMVtransport.errors...
FAILED tests/test_rmvtransport.py::test_getdepartures - RMVtransport.errors.R...
FAILED tests/test_rmvtransport.py::test_departures_products - RMVtransport.er...
FAILED tests/test_rmvtransport.py::test_departures_bad_request - RMVtransport...
FAILED tests/test_rmvtransport.py::test_midnight - RMVtransport.errors.RMVtra...
FAILED tests/test_rmvtransport.py::test_search_station - RMVtransport.errors....
FAILED tests/test_rmvtransport.py::test__query_rmv_api_fail - TypeError: rais...
================== 8 failed, 7 xfailed, 14 warnings in 0.71s ===================

Callback have changed.

fabaff commented 2 years ago

Looks like that #55 is addressing the issue.

cgtobi commented 2 years ago

Thanks @fabaff for following up on this.