[issue27341] mock.patch decorator fails silently on generators

2016-06-16 Thread Shoshana Berleant

New submission from Shoshana Berleant:

(at least in my case)

I committed two tests before I realized the tests were not being run: 
https://github.com/nipy/nipype/blob/abe7920a051f1570ccce4b71f26f50102d6e4e12/nipype/testing/tests/test_utils.py#L23

I realized this afternoon, while writing some more tests, that tests with the 
patch decorator were all reported as "OK", even when I wanted them to fail. 
Turns out they aren't being run at all.

I commented out all the yield statements, and the tests ran just as they should.

I don't know exactly what is going on here, but might raising an error or 
warning be good here?

Originally filed here: https://github.com/testing-cabal/mock/issues/366

--
components: Tests
messages: 268709
nosy: shoshber
priority: normal
severity: normal
status: open
title: mock.patch decorator fails silently on generators
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue27341] mock.patch decorating a generator returns a regular function.

2016-06-17 Thread Shoshana Berleant

Shoshana Berleant added the comment:

output

--
Added file: http://bugs.python.org/file43444/actual.out

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



[issue27341] mock.patch decorating a generator returns a regular function.

2016-06-17 Thread Shoshana Berleant

Shoshana Berleant added the comment:

I attached a file with 4 tests and the output. nosetests reports that all four 
tests were executed. In reality, only two tests were executed.

--
Added file: http://bugs.python.org/file43443/silentfail.py

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