mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
N/A: Fix UnicodeDecodeError with Python 2.7 and newer versions of py.test
This commit is contained in:
parent
73ee122c09
commit
b21461be15
@ -225,9 +225,12 @@ class TestGetValidHistoryWithoutCurrent(object):
|
|||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def history(self, mocker):
|
def history(self, mocker):
|
||||||
return mocker.patch('thefuck.shells.shell.get_history',
|
mock = mocker.patch('thefuck.shells.shell.get_history')
|
||||||
return_value=['le cat', 'fuck', 'ls cat',
|
# Passing as an argument causes `UnicodeDecodeError`
|
||||||
'diff x', 'nocommand x', u'café ô'])
|
# with newer py.test and python 2.7
|
||||||
|
mock.return_value = ['le cat', 'fuck', 'ls cat',
|
||||||
|
'diff x', 'nocommand x', u'café ô']
|
||||||
|
return mock
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def alias(self, mocker):
|
def alias(self, mocker):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user