[3.8] bpo-37795: Capture DeprecationWarnings in the test suite (GH-15184) (GH-15188)

(cherry picked from commit aa542c2)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2 files changed