ross / requests-futures

Asynchronous Python HTTP Requests for Humans using Futures
Other
2.11k stars 152 forks source link

Deprecation Warning: The 'warn' method is deprecated, use 'warning' instead after updating to latest pytest version #80

Closed aonamrata closed 5 years ago

aonamrata commented 5 years ago

I recently updated my pytest and all related modules to latest and started getting this deprecation warning. requests_futures\sessions.py:94: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

Full log

$ py.test tests/
===================================================================== test session starts =====================================================================
platform win32 -- Python 3.6.0, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: D:\orchardws\python-myrepo, inifile:
plugins: mock-1.10.2, cov-2.6.1
collected 33 items

tests\test_flask_logger.py ...............                                                                                                               [ 45%]
tests\test_logging.py ..................                                                                                                                 [100%]

====================================================================== warnings summary =======================================================================
tests/test_flask_logger.py::test_add_correlation_id_to_response
  d:\orchardws\python-myrepo\env36\lib\site-packages\requests_futures\sessions.py:94: DeprecationWarning: The 'warn' method is deprecated, use 'warning' inst
ead
    logger.warn('`background_callback` is deprecated and will be '

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============================================================ 33 passed, 1 warnings in 0.38 seconds ============================================================

Solution: Fix should be pretty simple text change here and any tests that might fail. Do you want me to issue a pull request?

ross commented 5 years ago

Heh, a deprecation warning on a deprecation warning. I hadn't seen that log.warn was deprecated. There'll be a lot of things getting that message.

I'd welcome a PR if you want to make a pass at it. Otherwise I'll take a look the next time I'm working on the library.

ross commented 5 years ago

Fixed by https://github.com/ross/requests-futures/pull/82