From 4fa6056e7250fc6805a8b9645907722851fdcfa7 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 17 Oct 2023 10:50:06 -0700 Subject: [PATCH] =?UTF-8?q?PYTHON-2878=20Allow=20passing=20dict=20to=20sor?= =?UTF-8?q?t/create=5Findex/hint=20performance=20=E2=80=A6=20(#1396)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_client.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/test/test_client.py b/test/test_client.py index 1039031e0..b8f0765ea 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -1837,26 +1837,16 @@ class TestClient(IntegrationTest): ) def test_dict_hints(self): - c = rs_or_single_client() - try: - c.t.t.find(hint={"x": 1}) - except Exception: - self.fail("passing a dictionary hint to find failed!") + self.db.t.find(hint={"x": 1}) def test_dict_hints_sort(self): - c = rs_or_single_client() - try: - result = c.t.t.find() - result.sort({"x": 1}) - except Exception: - self.fail("passing a dictionary to sort failed!") + result = self.db.t.find() + result.sort({"x": 1}) + + self.db.t.find(sort={"x": 1}) def test_dict_hints_create_index(self): - c = rs_or_single_client() - try: - c.t.t.create_index({"x": pymongo.ASCENDING}) - except Exception: - self.fail("passing a dictionary to create_index failed!") + self.db.t.create_index({"x": pymongo.ASCENDING}) class TestExhaustCursor(IntegrationTest):