python / python/cpython

Create `unittest` assertRaises conventions for exception groups

Aperta
#137,311 6 commenti 1 reazione 1 assegnatario Vedi su GitHub

@sobolevn ci sta già lavorando.

Dal 3/8/2025.

tests type-feature
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Feature or enhancement

Proposal:

unittest.TestCase has a variety of assertRaises flavor APIs. We need to better explain how to practically use these with exception groups and the ExceptionGroup type. Possibly add additional APIs to make them easier.

This is a tracking issue for the linked discussion in case people have PRs to propose.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/improve-support-for-exception-groups-in-unittest/100803

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.