Closed Mityuha closed 3 months ago
Now it's possible to patch attributes this way (from the docs):
async def test_example_3(bakery_mock: BakeryMock) -> None: bakery_mock.settings = lambda dsn: "any value" async with bakery_mock(MyBakery): assert MyBakery().settings == "any value"
As the practice show such a behaviour is an error prone and leads to confusion. There is a suggestion to get rid of any implicit behaviour in favour of explicit Cake objects' behaviour, like this
async def test_example_3(bakery_mock: BakeryMock) -> None: bakery_mock.settings = Cake(lambda dsn: "any value") async with bakery_mock(MyBakery): assert MyBakery().settings == "any value"
Implemented in 0.3.6 version
Now it's possible to patch attributes this way (from the docs):
As the practice show such a behaviour is an error prone and leads to confusion. There is a suggestion to get rid of any implicit behaviour in favour of explicit Cake objects' behaviour, like this