The `unittest` `-b` command line option hides the output of `pdb`.
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug report
Bug description:
import unittest
class Test(unittest.TestCase):
def test(self):
print("hello")
breakpoint()
print("goodbye")
If I invoke this like:
$ python3 -m unittest -b repo.py
Nothing is printed and the process sits waiting on input.
Whereas without the -b option we get the Pdb prompt:
$ python3 -m unittest repo.py
hello
> /home/matthew/code/coveragepy_issue_1963/repo.py(7)test()
-> print("goodbye")
(Pdb)
I would expect that the debugger prompt would not be swallowed up by the "-b" option, or that some error message would pop up saying that the "-b" option and the debugger were incompatible.
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo il riproduttore segnalato python3 -m unittest -b repo.py e confrontalo con il comando senza buffering. Traccia il modo in cui il buffering dell'output -b di unittest interagisce con breakpoint() e pdb, quindi aggiungi la copertura per questa interazione; il lavoro è completato quando il prompt del debugger è utilizzabile o viene prodotto un errore esplicito di incompatibilità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100