Fix issue where fixtures would lose the decorated functionality

Fix #3774
This commit is contained in:
Bruno Oliveira
2018-08-04 15:14:00 -03:00
parent a76cc8f8c4
commit ef8ec01e39
5 changed files with 67 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
"""Reproduces issue #3774"""
import mock
import pytest
config = {"mykey": "ORIGINAL"}
@pytest.fixture(scope="function")
@mock.patch.dict(config, {"mykey": "MOCKED"})
def my_fixture():
return config["mykey"]
def test_foobar(my_fixture):
assert my_fixture == "MOCKED"