bpo-33988: Fix test_warnings using -W error (GH-7985)

Use DeprecationWarning instead of PendingDeprecationWarning.
2 files changed