Pylons / Pylons/webob

1.8.7: pytest warnings

Open
#433 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
443
Forks
206
PR merge metrics
No merged PRs in 30d

Description

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-webob-1.8.7-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-webob-1.8.7-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/webob-1.8.7, configfile: setup.cfg, testpaths: src/webob, tests
collected 2389 items

tests/test_acceptparse.py .......................................................................................................................................... [  5%]
.................................................................................................................................................................... [ 12%]
.................................................................................................................................................................... [ 19%]
.................................................................................................................................................................... [ 26%]
.................................................................................................................................................................... [ 33%]
.................................................................................................................................................................... [ 40%]
.................................................................................................................................................................... [ 46%]
....................................................................................................................................                                 [ 52%]
tests/test_byterange.py ...............                                                                                                                              [ 53%]
tests/test_cachecontrol.py ...............................                                                                                                           [ 54%]
tests/test_client.py .............                                                                                                                                   [ 54%]
tests/test_client_functional.py ....                                                                                                                                 [ 55%]
tests/test_compat.py ...........                                                                                                                                     [ 55%]
tests/test_cookies.py .............................................s.s.s................................................                                             [ 59%]
tests/test_cookies_bw.py .                                                                                                                                           [ 59%]
tests/test_datetime_utils.py ......                                                                                                                                  [ 59%]
tests/test_dec.py .........................                                                                                                                          [ 61%]
tests/test_descriptors.py ...............................................................................................................................            [ 66%]
tests/test_etag.py ..........................                                                                                                                        [ 67%]
tests/test_etag_nose.py .......                                                                                                                                      [ 67%]
tests/test_exc.py ........................................                                                                                                           [ 69%]
tests/test_headers.py .................                                                                                                                              [ 70%]
tests/test_in_wsgiref.py ..                                                                                                                                          [ 70%]
tests/test_misc.py ...s.........s.                                                                                                                                   [ 70%]
tests/test_multidict.py ........................................................................................................................                     [ 75%]
tests/test_request.py .............................................................................................................................................. [ 81%]
.......................................................................................................................s.s.s..............................s......... [ 88%]
...............................................................................                                                                                      [ 91%]
tests/test_response.py ..........................................................x.................................................................................. [ 97%]
..................                                                                                                                                                   [ 98%]
tests/test_static.py ....................                                                                                                                            [ 99%]
tests/test_transcode.py ......                                                                                                                                       [ 99%]
tests/test_util.py .......                                                                                                                                           [100%]

============================================================================= warnings summary =============================================================================
tests/test_request.py::TestRequest_functional::test_request_put
  /home/tkloczko/rpmbuild/BUILDROOT/python-webob-1.8.7-4.fc35.x86_64/usr/lib/python3.8/site-packages/webob/acceptparse.py:1262: DeprecationWarning: The behavior of .__contains__ for the Accept classes is currently being maintained for backward compatibility, but it will change in the future to better conform to the RFC.
    warnings.warn(

tests/test_request.py::TestRequest_functional::test_request_put
  /home/tkloczko/rpmbuild/BUILDROOT/python-webob-1.8.7-4.fc35.x86_64/usr/lib/python3.8/site-packages/webob/acceptparse.py:645: DeprecationWarning: The behavior of AcceptValidHeader.__contains__ is currently being maintained for backward compatibility, but it will change in the future to better conform to the RFC.
    warnings.warn(

tests/test_response.py::test_set_cookie_expires_is_datetime_and_max_age_is_None
tests/test_response.py::test_set_cookie_expires_is_timedelta_and_max_age_is_None
tests/test_response.py::test_set_cookie_expires_is_datetime_tz_and_max_age_is_None
  /home/tkloczko/rpmbuild/BUILDROOT/python-webob-1.8.7-4.fc35.x86_64/usr/lib/python3.8/site-packages/webob/response.py:1037: DeprecationWarning: Argument "expires" will be removed in a future version of WebOb, please use "max_age".
    warn_deprecation('Argument "expires" will be removed in a future '

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_cookies.py:375: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_cookies.py:387: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_cookies.py:401: condition: sys.version_info >= (3, 0)
SKIPPED [2] tests/test_misc.py:35: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_request.py:2179: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_request.py:2193: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_request.py:2207: condition: sys.version_info >= (3, 0)
SKIPPED [1] tests/test_request.py:2491: condition: sys.version_info >= (3, 0)
XFAIL tests/test_response.py::test_response_file_body_tell
  Python 3.6 and up requires that rbo is seekable.
========================================================= 2379 passed, 9 skipped, 1 xfailed, 5 warnings in 10.64s ==========================================================

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running pytest and inspect the warnings from tests/test_request.py and tests/test_response.py. The reported sources are webob/acceptparse.py and webob/response.py; determine how the five deprecation warnings should be addressed and confirm the test run no longer emits them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.