fix issue473: work around mock putting an unbound method into a class
dict when double-patching. --HG-- branch : issue473
This commit is contained in:
@@ -164,6 +164,21 @@ class TestMockDecoration:
|
||||
names = [x.nodeid.split("::")[-1] for x in calls]
|
||||
assert names == ["test_one", "test_two", "test_three"]
|
||||
|
||||
def test_mock_double_patch_issue473(self, testdir):
|
||||
testdir.makepyfile("""
|
||||
from mock import patch
|
||||
from pytest import mark
|
||||
|
||||
@patch('os.getcwd')
|
||||
@patch('os.path')
|
||||
@mark.slow
|
||||
class TestSimple:
|
||||
def test_simple_thing(self, mock_path, mock_getcwd):
|
||||
pass
|
||||
""")
|
||||
res = testdir.inline_run()
|
||||
res.assertoutcome(passed=1)
|
||||
|
||||
|
||||
class TestReRunTests:
|
||||
def test_rerun(self, testdir):
|
||||
|
||||
Reference in New Issue
Block a user