File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -444,16 +444,16 @@ async def test_metadata(self, simple_client):
444
444
options = client .options
445
445
assert len (bson .encode (options .pool_options .metadata )) <= _MAX_METADATA_SIZE
446
446
447
- @mock .patch .dict ("os.environ" , {ENV_VAR_K8S : "1" })
448
447
async def test_container_metadata (self , simple_client ):
449
- metadata = copy .deepcopy (_METADATA )
450
- metadata ["driver" ]["name" ] = "PyMongo|async"
451
- metadata ["env" ] = {}
452
- metadata ["env" ]["container" ] = {"orchestrator" : "kubernetes" }
448
+ with mock .patch ("os.environ" , {ENV_VAR_K8S : "1" }):
449
+ metadata = copy .deepcopy (_METADATA )
450
+ metadata ["driver" ]["name" ] = "PyMongo|async"
451
+ metadata ["env" ] = {}
452
+ metadata ["env" ]["container" ] = {"orchestrator" : "kubernetes" }
453
453
454
- client = await simple_client ("mongodb://foo:27017/?appname=foobar&connect=false" )
455
- options = client .options
456
- assert options .pool_options .metadata ["env" ] == metadata ["env" ]
454
+ client = await simple_client ("mongodb://foo:27017/?appname=foobar&connect=false" )
455
+ options = client .options
456
+ assert options .pool_options .metadata ["env" ] == metadata ["env" ]
457
457
458
458
async def test_kwargs_codec_options (self , simple_client ):
459
459
class MyFloatType :
Original file line number Diff line number Diff line change @@ -426,16 +426,16 @@ def test_metadata(self, simple_client):
426
426
options = client .options
427
427
assert len (bson .encode (options .pool_options .metadata )) <= _MAX_METADATA_SIZE
428
428
429
- @mock .patch .dict ("os.environ" , {ENV_VAR_K8S : "1" })
430
429
def test_container_metadata (self , simple_client ):
431
- metadata = copy .deepcopy (_METADATA )
432
- metadata ["driver" ]["name" ] = "PyMongo"
433
- metadata ["env" ] = {}
434
- metadata ["env" ]["container" ] = {"orchestrator" : "kubernetes" }
430
+ with mock .patch ("os.environ" , {ENV_VAR_K8S : "1" }):
431
+ metadata = copy .deepcopy (_METADATA )
432
+ metadata ["driver" ]["name" ] = "PyMongo"
433
+ metadata ["env" ] = {}
434
+ metadata ["env" ]["container" ] = {"orchestrator" : "kubernetes" }
435
435
436
- client = simple_client ("mongodb://foo:27017/?appname=foobar&connect=false" )
437
- options = client .options
438
- assert options .pool_options .metadata ["env" ] == metadata ["env" ]
436
+ client = simple_client ("mongodb://foo:27017/?appname=foobar&connect=false" )
437
+ options = client .options
438
+ assert options .pool_options .metadata ["env" ] == metadata ["env" ]
439
439
440
440
def test_kwargs_codec_options (self , simple_client ):
441
441
class MyFloatType :
You can’t perform that action at this time.
0 commit comments