From 1edbfad0c8afc17e899b7982cd4c7942deab16f1 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Thu, 17 Nov 2022 12:27:15 -0800 Subject: [PATCH] PYTHON-3529 Improve reliability of test_list_databases (#1120) --- test/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_client.py b/test/test_client.py index a33881fded..53a234a33d 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -791,6 +791,10 @@ def test_list_databases(self): 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)