Opened on 11/14/2018 at 05:05:14 PM
Closed on 01/26/2019 at 03:30:16 AM
#7123 closed defect (fixed)
Pytest DepreciationWarnings
Reported by: | atudor | Assignee: | rhowell |
---|---|---|---|
Priority: | P4 | Milestone: | |
Module: | Sitescripts | Keywords: | |
Cc: | kvas | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Environment
Sitescripts from this commit: https://hg.adblockplus.org/sitescripts/rev/ee924091256b
Result of pip freeze on the testing venv:
asn1crypto==0.24.0 atomicwrites==1.2.1 attrs==18.2.0 cffi==1.11.5 configparser==3.5.0 coverage==4.5.1 cryptography==2.3.1 enum34==1.1.6 flake8==3.6.0 flake8-commas==2.0.0 flake8-docstrings==1.3.0 flake8-eyeo==0.1 flake8-per-file-ignores==0.6 flake8-polyfill==1.0.2 funcsigs==1.0.2 httplib2==0.11.3 idna==2.7 ipaddress==1.0.22 Jinja2==2.10 MarkupSafe==1.1.0 mccabe==0.6.1 mock==2.0.0 more-itertools==4.3.0 oauth2client==4.1.3 pathlib2==2.3.2 pathmatch==0.2.1 pbr==5.1.1 pep8-naming==0.7.0 pluggy==0.8.0 py==1.7.0 pyasn1==0.4.4 pyasn1-modules==0.2.2 pycodestyle==2.4.0 pycparser==2.19 pycrypto==2.6.1 pydocstyle==3.0.0 pyflakes==2.0.0 pysed==0.7.8 pytest==3.10.0 pytest-cov==2.6.0 pytest-mock==1.10.0 rsa==4.0 scandir==1.9.0 six==1.11.0 snowballstemmer==1.2.1 typing==3.6.6 wsgi-intercept==1.8.0
How to reproduce
- Clone the module from the version above.
- Run tox.
Observed behaviour
A bunch of warnings caused by pytest occur:
sitescripts/formmail/test/test_formmail.py::test_get_error /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_no_name /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_no_email /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_no_subject /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_no_message /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_bad_email /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail.py::test_success /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/web/formmail.py:25: DeprecationWarning: setupStderr() is deprecated. If you write text to stderr that might be non-ASCII use the "logging" module instead. setupStderr(environ['wsgi.errors']) sitescripts/formmail/test/test_formmail2.py::test_config_errors[url-No URL configured for form handler: test] /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/test/test_formmail2.py:104: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 assert error.value.message == message sitescripts/formmail/test/test_formmail2.py::test_config_errors[fields-No fields configured for form handler: test] /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/test/test_formmail2.py:104: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 assert error.value.message == message sitescripts/formmail/test/test_formmail2.py::test_config_errors[template-No template configured for form handler: test] /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/test/test_formmail2.py:104: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 assert error.value.message == message sitescripts/formmail/test/test_formmail2.py::test_config_field_errors /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/test/test_formmail2.py:155: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 assert error.value.message == 'No fields configured for form handler: test' sitescripts/formmail/test/test_formmail2.py::test_config_template_errors /Users/tavram/Documents/code/sitescripts/sitescripts/formmail/test/test_formmail2.py:162: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 assert error.value.message == 'Template not found at: no' -- Docs: https://docs.pytest.org/en/latest/warnings.html
Expected behaviour
No warnings to be displayed.
Attachments (0)
Change History (5)
comment:1 Changed on 11/14/2018 at 05:06:50 PM by kvas
- Priority changed from Unknown to P4
- Ready set
comment:2 Changed on 01/18/2019 at 11:40:13 PM by rhowell
- Owner set to rhowell
comment:3 Changed on 01/18/2019 at 11:40:48 PM by rhowell
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:4 Changed on 01/18/2019 at 11:43:40 PM by rhowell
comment:5 Changed on 01/26/2019 at 03:30:16 AM by rhowell
- Resolution set to fixed
- Status changed from reviewing to closed
Note: See
TracTickets for help on using
tickets.
I didn't realize there was already a ticket for this, and it was pretty trivial to implement after removing the previous version of formmail.py for #4413. The codereview references a Noissue, but I'll change the commit message to include this issue number.