Skip to content
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

pytest 3.8.0 crashes before running the test suite because of a deprecation warning inside ipython #651

Closed
njsmith opened this issue Sep 7, 2018 · 3 comments · Fixed by #653

Comments

@njsmith
Copy link
Member

njsmith commented Sep 7, 2018

============================= test session starts ==============================
platform darwin -- Python 3.5.3, pytest-3.8.0, py-1.6.0, pluggy-0.7.1 -- /Users/jenkins/workspace/-594-SV5AYVYYLSFPHE6/trio/.venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/jenkins/workspace/-594-SV5AYVYYLSFPHE6/trio, inifile:
plugins: faulthandler-1.5.0, cov-2.6.0
collecting ... collected 434 items / 1 errors


==================================== ERRORS ====================================
 ERROR collecting .venv/lib/python3.5/site-packages/trio/_core/tests/test_multierror.py
../.venv/lib/python3.5/site-packages/trio/_core/tests/test_multierror.py:584: in <module>
    import IPython
../.venv/lib/python3.5/site-packages/IPython/__init__.py:55: in <module>
    from .terminal.embed import embed
../.venv/lib/python3.5/site-packages/IPython/terminal/embed.py:14: in <module>
    from IPython.core.magic import Magics, magics_class, line_magic
../.venv/lib/python3.5/site-packages/IPython/core/magic.py:20: in <module>
    from IPython.core import oinspect
../.venv/lib/python3.5/site-packages/IPython/core/oinspect.py:29: in <module>
    from IPython.lib.pretty import pretty
../.venv/lib/python3.5/site-packages/IPython/lib/pretty.py:91: in <module>
    from IPython.utils.signatures import signature
../.venv/lib/python3.5/site-packages/IPython/utils/signatures.py:9: in <module>
    DeprecationWarning, stacklevel=2)
E   DeprecationWarning: IPython.utils.signatures backport for Python 2 is deprecated in IPython 6, which only supports Python 3

For now we pinned to pytest 3.7.4: #650

@njsmith
Copy link
Member Author

njsmith commented Sep 8, 2018

Ah, so this is actually a combination of things:

  • pytest 3.8.0 started displaying warnings that get triggered collection. This is a good thing, it means warnings are less likely to slip under the radar.
  • in our CI, we run pytest with -W error. This is a good thing, it turns warnings into errors, so we notice them.

...but the combination is not so nice, because it turns out that IPython has been generating this meaningless warning all along, but now we're actually noticing it.

Maybe we can set up our warnings filter to explicitly ignore this warning?

njsmith added a commit to njsmith/trio that referenced this issue Sep 8, 2018
And unpin pytest again, since the pin in python-triogh-650 was just a temporary
fix.

Fixes python-triogh-651.
@njsmith
Copy link
Member Author

njsmith commented Sep 8, 2018

Oh nice, another one (py 3.7 only):

=================================== ERRORS ====================================
____________ ERROR collecting trio/_core/tests/test_multierror.py _____________
..\trio\_core\tests\test_multierror.py:592: in <module>
    import IPython
C:\Python37\lib\site-packages\IPython\__init__.py:55: in <module>
    from .terminal.embed import embed
C:\Python37\lib\site-packages\IPython\terminal\embed.py:16: in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
C:\Python37\lib\site-packages\IPython\terminal\interactiveshell.py:18: in <module>
    from prompt_toolkit.document import Document
C:\Python37\lib\site-packages\prompt_toolkit\__init__.py:16: in <module>
    from .interface import CommandLineInterface
C:\Python37\lib\site-packages\prompt_toolkit\interface.py:19: in <module>
    from .application import Application, AbortAction
C:\Python37\lib\site-packages\prompt_toolkit\application.py:8: in <module>
    from .key_binding.bindings.basic import load_basic_bindings
C:\Python37\lib\site-packages\prompt_toolkit\key_binding\bindings\basic.py:9: in <module>
    from prompt_toolkit.renderer import HeightIsUnknownError
C:\Python37\lib\site-packages\prompt_toolkit\renderer.py:11: in <module>
    from prompt_toolkit.styles import Style
C:\Python37\lib\site-packages\prompt_toolkit\styles\__init__.py:8: in <module>
    from .from_dict import *
C:\Python37\lib\site-packages\prompt_toolkit\styles\from_dict.py:9: in <module>
    from collections import Mapping
<frozen importlib._bootstrap>:1032: in _handle_fromlist
    ???
C:\Python37\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

@Zac-HD
Copy link
Member

Zac-HD commented Sep 11, 2018

FYI @njsmith - GitHub supports syntax highlighting for python-traceback 😄

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 a pull request may close this issue.

2 participants