pytest-dev / pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
https://pytest.org
MIT License
12.18k stars 2.7k forks source link

Remove exceptiongroups from getting started page? #12883

Open The-Compiler opened 1 month ago

The-Compiler commented 1 month ago

Motivated by #12880, which proposes adding even more content to the "getting started with pytest" page, intended for teaching the very basics of pytest's functionality:

Personally I think exception groups shouldn't be on a page describing how to write your first test at all. It's not a feature new pytest (and potentially Python) users necessarily need to know about when just starting out. We don't even explain e.g. match= for pytest.raises on that page.

If we keep it, at the very least it shouldn't be between an example being shown, and that example being run later...:

image

But IMHO it has no place there at all, and the How to write and report assertions in tests page already has a very similar explanation, where it does seem to fit in well.

@lanzz @Zac-HD what do you think?

lanzz commented 1 month ago

I don't mind removing it from getting-started.rst, your reasoning is compelling and I might have gone a bit overboard in adding it there in the first place.

Zac-HD commented 1 month ago

Sounds good to me - let's cut back to the first very simple example, and then just say e.g. "Assertions about expected exceptions explains how to match exception messages or the contents of ExceptionGroup." so that it's easy to find for anyone who knows they need that.