I'm learning to use mock when testing with pytest.
I got a simple test function:
import pytest
import smtplib
def test_send_email():
with mocker.patch('smtplib.SMTP') as mock:
assert True
But when I try to run this test I got the following error: NameError: name 'mocker' is not defined
.
I already verified that mock
, pytest
and pytest-mock
are correctly installed.
What am I doing wrong ?