Skip to content

Error when attempting to use IPython debugger #2064

Closed
@abalkin

Description

@abalkin

Problem description

From py.test help:

  --pdb                 start the interactive Python debugger on errors.
  --pdbcls=modulename:classname
                        start a custom interactive Python debugger on errors. For example:
                        --pdbcls=IPython.terminal.debugger:TerminalPdb

I created a simple test file containing just

def test_pdb():
    assert 0

And ran py.test as follows:

$ py.test  test_pdb.py \
--pdbcls=IPython.terminal.debugger:TerminalPdb \
--pdb

The result was an internal error with the following traceback:

Traceback (most recent call last):
  File ".../_pytest/main.py", line 96, in wrap_session
    session.exitstatus = doit(config, session) or 0
  ...
  File ".../IPython/terminal/debugger.py", line 38, in pt_init
    self.pt_cli = CommandLineInterface(self._pt_app, eventloop=self.shell._eventloop)
AttributeError: 'TerminalInteractiveShell' object has no attribute '_eventloop'

Installed packages

$ pip freeze
appnope==0.1.0
decorator==4.0.10
entrypoints==0.2.2
ipykernel==4.5.0
ipython==5.1.0
ipython-genutils==0.1.0
ipywidgets==5.2.2
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.4.0
jupyter-console==5.0.0
jupyter-core==4.2.0
MarkupSafe==0.23
mistune==0.7.3
nbconvert==4.2.0
nbformat==4.1.0
notebook==4.2.3
pexpect==4.2.1
pickleshare==0.7.4
pluggy==0.4.0
prompt-toolkit==1.0.9
ptyprocess==0.5.1
py==1.4.31
Pygments==2.1.3
pytest==3.0.4
pyzmq==16.0.1
qtconsole==4.2.1
simplegeneric==0.8.1
six==1.10.0
terminado==0.6
tornado==4.4.2
traitlets==4.3.1
wcwidth==0.1.7
widgetsnbextension==1.2.6

Pytest and operating system versions

I am using pytest 3.0.4 and

$ python
Python 3.5.2+ (3.5:da2ac103d326+, Nov 15 2016, 14:14:18)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin

Issue checklist

  • Include a detailed description of the bug or suggestion
  • pip list of the virtual environment you are using
  • pytest and operating system versions
  • Minimal example if possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: debuggingrelated to the debugging builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions