1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 19:01:13 +01:00
thefuck/tests/shells/conftest.py

23 lines
459 B
Python
Raw Normal View History

2016-01-23 02:06:22 +00:00
import pytest
@pytest.fixture
def builtins_open(mocker):
return mocker.patch('six.moves.builtins.open')
@pytest.fixture
def isfile(mocker):
return mocker.patch('os.path.isfile', return_value=True)
@pytest.fixture
@pytest.mark.usefixtures('isfile')
def history_lines(mocker):
def aux(lines):
mock = mocker.patch('io.open')
mock.return_value.__enter__ \
.return_value.readlines.return_value = lines
2016-01-29 10:09:40 +00:00
2016-01-23 02:06:22 +00:00
return aux