2018-08-05 02:14:00 +08:00
|
|
|
"""Reproduces issue #3774"""
|
2019-05-28 07:31:52 +08:00
|
|
|
from unittest import mock
|
2018-08-05 02:14:00 +08:00
|
|
|
|
|
|
|
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"
|