[openstack-dev] [nova] contextlib.nested and Python3 failing

melanie witt melwittt at gmail.com
Thu Aug 20 00:42:16 UTC 2015


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>


More information about the OpenStack-dev mailing list