Use more specific asserts in dbm tests. (GH-7786)

This may help to investigate bpo-33901.
2 files changed