Pytest-mock fixture configuration

Asked

Viewed 238 times

1

I would like to do tests using pytest-mock. I have already run the Pip install pytest-mock command and installed it, but when I run the test below pytest can’t find the fixture. What can be?

import pytest    
def test_unix_fs(mocker):
    mocker.patch('os.remove')
    UnixFS.rm('file')
    os.remove.assert_called_once_with('file')

def test_unix_fs(mocker): E fixture 'mocker' not found

  available fixtures: cache, capfd, capsys, doctest_namespace, get_attribute, monkeypatch, pytestconfig, record_xml_property, recwarn, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

pytest-mock website: https://pypi.python.org/pypi/pytest-mock

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.