Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Ran Benita <ran@unusedvar.com>
20 lines
323 B
Python
20 lines
323 B
Python
# mypy: allow-untyped-defs
|
|
"""Reproduces issue #3774"""
|
|
|
|
from unittest 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"
|