PYTHON-3529 Improve reliability of test_list_databases (#1120)

This commit is contained in:
Shane Harvey 2022-11-17 12:27:15 -08:00 committed by GitHub
parent cde9adf6ab
commit 1edbfad0c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -791,6 +791,10 @@ class TestClient(IntegrationTest):
self.assertIsInstance(cursor, CommandCursor)
helper_docs = list(cursor)
self.assertTrue(len(helper_docs) > 0)
# sizeOnDisk can change between calls.
for doc_list in (helper_docs, cmd_docs):
for doc in doc_list:
doc.pop("sizeOnDisk", None)
self.assertEqual(helper_docs, cmd_docs)
for doc in helper_docs:
self.assertIs(type(doc), dict)