mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-09 21:34:05 +01:00
#N/A: Split shells
module
This commit is contained in:
21
tests/shells/conftest.py
Normal file
21
tests/shells/conftest.py
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
return aux
|
Reference in New Issue
Block a user