Skip to content

Fix DeprecationWarning in tests when accessing collections.abc classes via collections #6473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

tirkarthi
Copy link
Contributor

This is a follow up PR on #6268 to fix similar cases in tests as noted in #6268 (comment)

Thanks for the library :)

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can fix the lint failure I'll take this, but I'd rather wait until we're running against 3.8 to be honest. I'm not even seeing these warnings running the test suite on 3.7 with -Wall.

@tirkarthi
Copy link
Contributor Author

I have fixed the linter errors. I too couldn't see the warnings but I am not sure if pytest is doing something with that. Using python3.7 -Wall on master shows me the warnings as below :

(pydev-venv)  > ~/django-rest-framework on master   python3.7 -Wall tests/test_serializer.py
tests/test_serializer.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping
Traceback (most recent call last):
  File "tests/test_serializer.py", line 10, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'
(pydev-venv)  > ~/django-rest-framework on master   python3.7 -Wall tests/test_renderers.py
tests/test_renderers.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping, OrderedDict
Traceback (most recent call last):
  File "tests/test_renderers.py", line 7, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, super. Thanks for the update.

@carltongibson carltongibson merged commit 739b0a2 into encode:master Feb 25, 2019
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants