Robert Collins added the comment:

There are two related things here.

Firstly, the generator's body will run without the patch (because the wrapping 
function has 

try:
   return decorated(..)
finally:
   unpwatch()

Secondly, the wrapping function is itself not a generator, and anything that 
introspects functions to see if they are generators will not detect the wrapped 
function as one - which is I suspect whats tripping nose up, but I haven't 
actually checked the nose code to see what its doing/expecting.

----------
nosy: +rbcollins
title: mock.patch decorator fails silently on generators -> mock.patch 
decorating a generator returns a regular function.

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to