File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -643,7 +643,8 @@ async def test_uri_options(self):
643
643
# Test explicit database
644
644
uri = "mongodb://user:pass@%s:%d/pymongo_test" % (host , port )
645
645
client = await async_rs_or_single_client_noauth (uri )
646
- self .assertRaises (OperationFailure , client .admin .command , "dbstats" )
646
+ with self .assertRaises (OperationFailure ):
647
+ await client .admin .command ("dbstats" )
647
648
self .assertTrue (await client .pymongo_test .command ("dbstats" ))
648
649
649
650
if async_client_context .is_rs :
Original file line number Diff line number Diff line change @@ -631,7 +631,8 @@ def test_uri_options(self):
631
631
# Test explicit database
632
632
uri = "mongodb://user:pass@%s:%d/pymongo_test" % (host , port )
633
633
client = rs_or_single_client_noauth (uri )
634
- self .assertRaises (OperationFailure , client .admin .command , "dbstats" )
634
+ with self .assertRaises (OperationFailure ):
635
+ client .admin .command ("dbstats" )
635
636
self .assertTrue (client .pymongo_test .command ("dbstats" ))
636
637
637
638
if client_context .is_rs :
You can’t perform that action at this time.
0 commit comments