Skip to content

Provide an interface consistent with pdb so that pudb can be used by pytest #221

Closed

Description

@anntzer

pytest provides the switch --pdb in order to enter a debugger whenever a test fails. In pytest-dev/pytest#1712 I added the --pdbcls flag to pytest so that one can specify an arbitrary Pdb subclass; e.g. one can call py.test --pdbcls=IPython.core.debugger:Pdb --pdb to use the ipython debugger instead.

Unfortunately it is currently not possible to pass in pudb (py.test --pdbcls=pudb.debugger:Debugger --pdb) because the Debugger.interaction method has a completely different signature than Pdb.interaction (which is the entry point used), leading to a crash of pytest. Specifically, the signatures are

pdb.Pdb.interaction(self, frame, traceback)

and

pudb.debugger.Debugger.interaction(self, frame, exc_tuple=None, show_exc_dialog=True)

Would it be possible to modify the signature of Debugger.interaction so that the second argument becomes, say, exc_tuple_or_traceback (to maintain backcompatibility and also be compatible with pytest)?

Activity

  1. asmeurer commented on Feb 3, 2017

    @asmeurer
    Collaborator

    It sounds good to me. Have you tested it to see if there are any other compatibility issues that pop up?

  2. anntzer commented on Feb 3, 2017

    @anntzer
    ContributorAuthor

    Well, I haven't implemented anything and am not so familiar with pudb's internals so I can't tell.

  3. inducer commented on Feb 3, 2017

    @inducer
    Owner

    Likewise, sounds good to me. Try it out and send a PR if it turns out to work.

  4. anntzer commented on Oct 21, 2021

    @anntzer
    ContributorAuthor

    Closed by #224, IIRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions