On 20 August 2015 at 01:42, melanie witt <[email protected]> wrote: > On Aug 19, 2015, at 16:51, Sylvain Bauza <[email protected]> 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()
+1 I have always found that more readable that the context manager thing, can't really explain why. johnthetubaguy __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
