Commit Graph

10 Commits

Author SHA1 Message Date
John Litborn 134b759e5d
raisesgroup followups (#13279)
* raisesgroup followups
* renames src/_pytest/raises_group.py to src/_pytest/raises.py
* moves pytest.raises from src/_pytest/python_api.py to src/_pytest/raises.py
* adds several newsfragments that should've been bundled with #13192
* add more detailed error message if you try to do RaisesGroup((ValueError, TypeError))
* mess around with ValueError vs TypeError on invalid expected exception
* revert change in behaviour if raises has a type mismatch
* add check example to raises, fix test after behaviour revert
* made args to AbstractMatcher, RaisesExc and RaisesGroup pos/kw-only

---------

Co-authored-by: Ran Benita <ran@unusedvar.com>
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-29 13:08:12 +00:00
John Litborn a98d093a71
improve raisesgroup code coverage (#13275)
* improve raisesgroup code coverage

* fix coverage of a weird branch in python_api, explicitify match in other test

* remove comment
2025-03-07 11:04:46 -08:00
jakkdl 09d06fe99d
fix tests 2025-02-20 17:14:43 +01:00
jakkdl 2c8cd64d5f
make pytest.raises use RaisesExc... which made me notice about a million small things differing between raises and RaisesExc, and some random other stuff... 2025-02-20 16:38:02 +01:00
jakkdl 4d2c70911b
fix imports after file rename 2025-02-18 15:16:36 +01:00
jakkdl c011e9b6f3 fix test, fix references in docstrings 2025-02-06 17:12:56 +01:00
jakkdl e73c4111d2 fix test on py<311 2025-02-06 15:52:56 +01:00
jakkdl e1e1874cda rename AbstractMatcher -> AbstractRaises, Matcher->RaisesExc. Add docs on RaisesGroup&RaisesExc. Add warnings to group_contains. Remove group_contains example from getting-started page 2025-02-06 15:39:25 +01:00
jakkdl 4737c8cf95 add AbstractMatcher support to xfail 2025-02-04 15:33:06 +01:00
jakkdl c93130c1b9 add RaisesGroup & Matcher 2025-02-04 13:31:23 +01:00