inducer / inducer/pudb

"Debugger instance already exists" when used in pytest

Open
#607 5 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Python
Stars
3.2k
Forks
245
Avg merge
13m
Merged PRs (30d)
5

Description

# Describe the bug
When 2 breakpoints are encountered in pytest with pudb set up, this error pops: Debugger instance already exists

# To Reproduce
Steps to reproduce the behavior:
1. install pudb and pytest in venv
2. create this `test.py`
```
def test_foo():
breakpoint()
breakpoint()
```
4. `pytest --pdbcls pudb.debugger:Debugger --pdb --capture=no test.py` (following https://documen.tician.de/pudb/starting.html#usage-with-pytest)
5. First breakpoint is encountered in pudb, press `c` to continue to second one
6. See error

# Expected behavior
The debugger should be called on second breakpoint

# Versions

pudb 2022.1.3

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided test.py reproduction and run the pytest command with pudb's Debugger class and --capture=no. Trace the Debugger lifecycle from the first breakpoint after pressing c to the second breakpoint. Done means the second breakpoint opens the debugger without a "Debugger instance already exists" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.