> pytest --version
This is pytest version 4.0.0, imported from c:\programdata\anaconda3\lib\site-packages\pytest.py
setuptools registered plugins:
pytest-remotedata-0.3.0 at c:\programdata\anaconda3\lib\site-packages\pytest_remotedata\plugin.py
pytest-openfiles-0.3.0 at c:\programdata\anaconda3\lib\site-packages\pytest_openfiles\plugin.py
pytest-doctestplus-0.1.3 at c:\programdata\anaconda3\lib\site-packages\pytest_doctestplus\plugin.py
pytest-arraydiff-0.2 at c:\programdata\anaconda3\lib\site-packages\pytest_arraydiff\plugin.py
DeprecationWarning causes in socks.py when pytest command is executed.
> pytest tests/
============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.0.0, py-1.6.0, pluggy-0.7.1 -- c:\programdata\anaconda3\python.exe
cachedir: .pytest_cache
rootdir: C:\vagrant\synced_folder\annofab-api-access-python-commons, inifile: pytest.ini
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collected 1 items
tests/test_annofab.py::test_account PASSED
============================== warnings summary ===============================
c:\programdata\anaconda3\lib\site-packages\socks.py:58
c:\programdata\anaconda3\lib\site-packages\socks.py:58: 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 Callable
Where does pytest use socks.py?
You can get a stack trace by running pytest with the -Werror argument, which should help track it down. I suspect it's actually in one of the plugins, perhaps pytest-remotedata.
I got a stack trace by running pytest with the -Werror.
> pytest -Werror tests\test_annofab.py::test_account
============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.0.0, py-1.6.0, pluggy-0.7.1 -- c:\programdata\anaconda3\python.exe
cachedir: .pytest_cache
rootdir: C:\vagrant\synced_folder\annofab-api-access-python-commons, inifile: pytest.ini
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2
collecting ...
=================================== ERRORS ====================================
___________________ ERROR collecting tests/test_annofab.py ____________________
tests\test_annofab.py:16: in <module>
from annofabapi.annofabapi import AnnofabApi
c:\programdata\anaconda3\lib\site-packages\annofabapi\__init__.py:1: in <module>
from annofabapi.annofabapi import AnnofabApi
c:\programdata\anaconda3\lib\site-packages\annofabapi\annofabapi.py:13: in <module>
from annofabapi.api import AnnofabApiMixin
c:\programdata\anaconda3\lib\site-packages\annofabapi\api.py:14: in <module>
import requests
c:\programdata\anaconda3\lib\site-packages\requests\__init__.py:115: in <module>
from .api import request, get, head, post, patch, put, delete, options
c:\programdata\anaconda3\lib\site-packages\requests\api.py:13: in <module>
from . import sessions
c:\programdata\anaconda3\lib\site-packages\requests\sessions.py:27: in <module>
from .adapters import HTTPAdapter
c:\programdata\anaconda3\lib\site-packages\requests\adapters.py:44: in <module>
from urllib3.contrib.socks import SOCKSProxyManager
c:\programdata\anaconda3\lib\site-packages\urllib3\contrib\socks.py:27: in <module>
import socks
c:\programdata\anaconda3\lib\site-packages\socks.py:58: in <module>
from collections import Callable
<frozen importlib._bootstrap>:1032: in _handle_fromlist
???
c:\programdata\anaconda3\lib\collections\__init__.py:52: in __getattr__
DeprecationWarning, stacklevel=2)
E DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
=========================== 1 error in 0.21 seconds ===========================
ERROR: not found: C:\vagrant\synced_folder\annofab-api-access-python-commons\tests\test_annofab.py::test_account
(no name 'C:\\vagrant\\synced_folder\\annofab-api-access-python-commons\\tests\\test_annofab.py::test_account' in any of [<Module 'tests/test_annofab.py'>])
I think that pytest and the DeprecationWarning are not related.
Hi @yuji38kwmt thanks for the follow up.
Indeed that's socks.py:
c:\programdata\anaconda3\lib\site-packages\socks.py:58: in <module>
from collections import Callable
I see you already reported that in https://github.com/Anorov/PySocks/issues/119, so I'm closing this. 👍
OK!
I've just hit the same problem. Is there any workaround for the time being?
Thanks!
You can ignore that warning specifically by adding this to your pytest.ini file:
[pytest]
filterwarnings=
ignore:Using or importing the ABCs.*
Thanks, Bruno,
It really helps!
-Daniel
On Thu, Jul 4, 2019 at 6:06 PM Bruno Oliveira notifications@github.com
wrote:
You can ignore that warning specifically by adding this to your pytest.ini
file:[pytest]filterwarnings=
ignore:Using or importing the ABCs.*—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pytest-dev/pytest/issues/4769?email_source=notifications&email_token=ALA3QXYFENPDOP2UD2R5IZ3P5ZX5BA5CNFSM4GWV6UZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZIF3VI#issuecomment-508583381,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALA3QX3A7DZLTHTYE2JQBP3P5ZX5BANCNFSM4GWV6UZA
.
Still a problem, there is a known workaround for the problem not for the warning?
platform linux -- Python 3.8.2, pytest-5.2.0, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python3
cachedir: .pytest_cache
======================================================================================== warnings summary ========================================================================================
/usr/lib/python3/dist-packages/socks.py:58
/usr/lib/python3/dist-packages/socks.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
from collections import Callable
-- Docs: https://docs.pytest.org/en/latest/warnings.html
@engFelipeMonteiro This has nothing to do with pytest. See https://github.com/Anorov/PySocks/issues/119 - given that a new version of PySocks with the fix has been released in May 2019, I'm guessing you still have an older version installed.
Most helpful comment
You can ignore that warning specifically by adding this to your
pytest.inifile: