Using Mock 0.8.0 and Nose 1.1.2:
test.py:
import mock
import useless_module
class TestClass:
def check_call(self, number, result):
assert result == number * 3
@mock.patch("useless_module.SomeClass")
def test_method(self, mock_someclass):
for i in range(3):
result = i * 3
yield self.check_call, i, result
useless_module.py:
class SomeClass:
def return_something():
raise
When running `nosetests test.py`, here's the output:
% nosetests test.py
.
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
Obviously, the test is not running the test generator. When I remove the patch,
it works fine:
% nosetests test.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.001s
OK
I attached the reproducible code.
Original issue reported on code.google.com by charlesa...@gmail.com on 3 Sep 2012 at 11:51
Original issue reported on code.google.com by
charlesa...@gmail.com
on 3 Sep 2012 at 11:51Attachments: