Advertisement
Guest User

Untitled

a guest
Feb 24th, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. ==> Making package: python-requests-cache 1.2.0-1 (Sat Feb 24 07:34:07 2024)
  2. ==> Retrieving sources...
  3. -> Downloading requests-cache-1.2.0.tar.gz...
  4. % Total % Received % Xferd Average Speed Time Time Time Current
  5. Dload Upload Total Spent Left Speed
  6. 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
  7. 100 2985k 0 2985k 0 0 2888k 0 --:--:-- 0:00:01 --:--:-- 9.8M
  8. ==> Validating source files with sha512sums...
  9. requests-cache-1.2.0.tar.gz ... Passed
  10. ==> Making package: python-requests-cache 1.2.0-1 (Sat Feb 24 07:34:09 2024)
  11. ==> Checking runtime dependencies...
  12. ==> Checking buildtime dependencies...
  13. ==> Retrieving sources...
  14. -> Found requests-cache-1.2.0.tar.gz
  15. ==> Validating source files with sha512sums...
  16. requests-cache-1.2.0.tar.gz ... Passed
  17. ==> Removing existing $srcdir/ directory...
  18. ==> Extracting sources...
  19. -> Extracting requests-cache-1.2.0.tar.gz with bsdtar
  20. bsdtar: Failed to set default locale
  21. ==> Sources are ready.
  22. python-requests-cache-1.2.0-1: parsing pkg list...
  23. ==> Making package: python-requests-cache 1.2.0-1 (Sat Feb 24 07:34:12 2024)
  24. ==> Checking runtime dependencies...
  25. ==> Checking buildtime dependencies...
  26. ==> WARNING: Using existing $srcdir/ tree
  27. ==> Starting build()...
  28. * Building wheel...
  29. Successfully built requests_cache-1.2.0-py3-none-any.whl
  30. ==> Starting check()...
  31. ============================================ test session starts =============================================
  32. platform linux -- Python 3.11.7, pytest-7.4.4, pluggy-1.4.0
  33. rootdir: /home/pieter/.cache/paru/clone/python-requests-cache/src/requests-cache-1.2.0
  34. plugins: requests-mock-1.11.0, socket-0.6.0, time-machine-2.13.0
  35. collected 381 items
  36.  
  37. tests/compat/test_requests_mock_combine_cache.py . [ 0%]
  38. tests/compat/test_requests_mock_disable_cache.py . [ 0%]
  39. tests/compat/test_requests_mock_load_cache.py . [ 0%]
  40. tests/compat/test_responses_load_cache.py . [ 1%]
  41. tests/unit/test_base_cache.py ...................... [ 6%]
  42. tests/unit/test_cache_keys.py ............................. [ 14%]
  43. tests/unit/test_patcher.py ........... [ 17%]
  44. tests/unit/test_serializers.py ..s..... [ 19%]
  45. tests/unit/test_session.py ........................................................................... [ 39%]
  46. ............................................F................................................ [ 63%]
  47. tests/unit/models/test_base.py .. [ 64%]
  48. tests/unit/models/test_raw_response.py ...... [ 65%]
  49. tests/unit/models/test_request.py . [ 65%]
  50. tests/unit/models/test_response.py ................. [ 70%]
  51. tests/unit/policy/test_actions.py .................................................................... [ 88%]
  52. ...................... [ 93%]
  53. tests/unit/policy/test_expiration.py ....................... [100%]
  54.  
  55. ================================================== FAILURES ==================================================
  56. ______________________________________ test_stale_if_error__error_code _______________________________________
  57.  
  58. mock_session = <CachedSession(cache=<SQLiteCache(name=/tmp/pytest-of-pieter/pytest-0/test_stale_if_error__error_cod0/dc18728d-1220-41...(allowable_methods=('GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'), expire_after=1, stale_if_error=True))>
  59.  
  60. @skip_pypy
  61. def test_stale_if_error__error_code(mock_session):
  62. """With stale_if_error, expect to get old cache data if a response has an error status code,
  63. that is not in allowable_codes.
  64. """
  65. mock_session.settings.stale_if_error = True
  66. mock_session.settings.expire_after = 1
  67. mock_session.settings.allowable_codes = (200,)
  68.  
  69. with time_travel(START_DT):
  70. assert mock_session.get(MOCKED_URL_200_404).status_code == 200
  71.  
  72. with time_travel(START_DT + timedelta(seconds=1.1)):
  73. response = mock_session.get(MOCKED_URL_200_404)
  74.  
  75. assert response.status_code == 200
  76. assert response.from_cache is True
  77. > assert response.is_expired is True
  78. E AssertionError: assert False is True
  79. E + where False = CachedResponse(_content=b'', created_at='2024-02-24 07:34:13.140594+00:00', elapsed=datetime.timedelta(microseconds=80...od='GET', url='http+mock://requests-cache.com/200-404'), status_code=200, url='http+mock://requests-cache.com/200-404').is_expired
  80.  
  81. tests/unit/test_session.py:475: AssertionError
  82. -------------------------------------------- Captured stdout call --------------------------------------------
  83. WARNING Request for URL session.py:307
  84. http+mock://requests-cache.com/200-404
  85. failed; using cached response
  86. ╭─ Traceback (most recent call last) ─╮
  87. │ /home/pieter/.cache/paru/clone/pyth │
  88. │ on-requests-cache/src/requests-cach │
  89. │ e-1.2.0/requests_cache/session.py:2 │
  90. │ 90 in _resend │
  91. │ │
  92. │ 287 │ │ │ │ self.settings │
  93. │ 288 │ │ │ │ and response. │
  94. │ 289 │ │ │ ): │
  95. │ ❱ 290 │ │ │ │ response.rais │
  96. │ 291 │ │ │ return response │
  97. │ 292 │ │ except Exception: │
  98. │ 293 │ │ │ return self._hand │
  99. │ │
  100. │ /usr/lib/python3.11/site-packages/r │
  101. │ equests/models.py:1021 in │
  102. │ raise_for_status │
  103. │ │
  104. │ 1018 │ │ │ ) │
  105. │ 1019 │ │ │
  106. │ 1020 │ │ if http_error_msg: │
  107. │ ❱ 1021 │ │ │ raise HTTPError( │
  108. │ 1022 │ │
  109. │ 1023 │ def close(self): │
  110. │ 1024 │ │ """Releases the conn │
  111. ╰─────────────────────────────────────╯
  112. HTTPError: 404 Client Error: None for
  113. url:
  114. http+mock://requests-cache.com/200-404
  115. --------------------------------------------- Captured log call ----------------------------------------------
  116. WARNING requests_cache.session:session.py:307 Request for URL http+mock://requests-cache.com/200-404 failed; using cached response
  117. Traceback (most recent call last):
  118. File "/home/pieter/.cache/paru/clone/python-requests-cache/src/requests-cache-1.2.0/requests_cache/session.py", line 290, in _resend
  119. response.raise_for_status()
  120. File "/usr/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
  121. raise HTTPError(http_error_msg, response=self)
  122. requests.exceptions.HTTPError: 404 Client Error: None for url: http+mock://requests-cache.com/200-404
  123. ========================================== short test summary info ===========================================
  124. FAILED tests/unit/test_session.py::test_stale_if_error__error_code - AssertionError: assert False is True
  125. ================================== 1 failed, 379 passed, 1 skipped in 4.40s ==================================
  126. ==> ERROR: A failure occurred in check().
  127. Aborting...
  128. error: failed to build 'python-requests-cache-1.2.0-1':
  129. error: packages failed to build: python-requests-cache-1.2.0-1
Tags: aur
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement