Code: Select all
import pytest
class Command():
def run(self):
x = "foo"
return x
def test(mocker):
mocker.patch("myapp.tests.test_mocker.Command.run.x", "bar")
c = Command()
print(c.run())
Code: Select all
import pytest
class Command():
def run(self):
x = "foo"
return x
def test(mocker):
mocker.patch("myapp.tests.test_mocker.Command.run.x", "bar")
c = Command()
print(c.run())