docs: fix patching external client/resource docs (#5804)

This commit is contained in:
Sean Coonce 2022-12-30 06:21:25 -08:00 committed by GitHub
parent 555928af5d
commit d89e4d236c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,7 +288,7 @@ If it is not possible to rearrange imports, we can patch the boto3-client or res
.. sourcecode:: python
# The client can come from an import, an __init__-file, wherever..
client = boto3.client("s3")
outside_client = boto3.client("s3")
s3 = boto3.resource("s3")
@mock_s3
@ -297,7 +297,7 @@ If it is not possible to rearrange imports, we can patch the boto3-client or res
patch_client(outside_client)
patch_resource(s3)
assert client.list_buckets()["Buckets"] == []
assert outside_client.list_buckets()["Buckets"] == []
assert list(s3.buckets.all()) == []