Qn / Feature Request - can I just make a moto
Session without worrying about mock lifetimes?
#8573
Labels
moto
Session without worrying about mock lifetimes?
#8573
The docs of moto recommend usage following a pattern of "start mocking", "use boto stuff", "stop mocking". e.g.
However, is it possible to use moto without interfering with global state like this? e.g. can I just ask for a moto session like:
? This feels much neater to me - there's no global state being mutated, and if my code is already structured to accept a Session via DI or something then it's a natural fit.
I've tried using
moto.core.base_backend.get_session
but it doesn't seem to work outside ofmock_aws()
being active.The text was updated successfully, but these errors were encountered: