pytest: 4.4.0 regression for pdbcls

In my code I’m trying to define my own debugger class, which in this case is a bit of a hack to use ipdb I have a file with:

class Debugger(object):
    quitting = None

    def set_trace(self, frame):
        import ipdb  # noqa

        return ipdb.set_trace(frame)  # noqa

    def reset(self, *args, **kwargs):
        from ipdb.__main__ import _init_pdb

        pdb_obj = _init_pdb()
        pdb_obj.botframe = None  # not sure. exception otherwise at quit
        return pdb_obj.reset(*args, **kwargs)

    def interaction(self, *args, **kwargs):
        from ipdb.__main__ import _init_pdb

        pdb_obj = _init_pdb()
        pdb_obj.botframe = None  # not sure. exception otherwise at quit
        return pdb_obj.interaction(*args, **kwargs)

The code is now unable to import any class in my codebase at that step. I just get No module name X for every module in my local repository.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah, I’m glad the new feature works for you - and somehow glad that it broke your current setup, since you might not have noticed otherwise… 😃 #5041 should fix it. I have some stashed change to make this more lazily even, but that is for later.

Thanks, and thanks for the suggestion about using ipdb directly instead based on the new version. In this case it just simplified what I was already doing.