Similar to #33549, but now for classes and not functions.
From #33549 comment:13
CC: @mkoeppe @soehms @tscrim
Component: doctest framework
Author: Tobias Diez
Branch/Commit: public/tests/pytest_rename_test_classes @ 969ef9d
Issue created by migration from https://trac.sagemath.org/ticket/33561