On Aug 19, 2015, at 16:51, Sylvain Bauza <sbauza at redhat.com> wrote: > Ideas appreciated. Instead of using the nested context managers, a way I like is to decorate a nested function in the test and call it, for example: def test_thing(self): @mock.patch(...) @mock.patch(...) @mock.patch(...) def do_test(..., ..., ...): ... do_test() -melanie (irc: melwitt) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150819/a6ebb6f8/attachment.pgp>