1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-08 12:53:58 +01:00

#N/A: Fix tests with py.test 4

This commit is contained in:
Vladimir Iakovlev
2018-11-21 19:43:01 +01:00
parent 81b05b9f88
commit 5b3350b2dd
4 changed files with 15 additions and 22 deletions

View File

@@ -3,9 +3,7 @@ from thefuck.rules.touch import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output(is_bsd):
print(is_bsd)
if is_bsd:
return "touch: /a/b/c: No such file or directory"
return "touch: cannot touch '/a/b/c': No such file or directory"
@@ -14,8 +12,8 @@ def output(is_bsd):
@pytest.mark.parametrize('script, is_bsd', [
('touch /a/b/c', False),
('touch /a/b/c', True)])
def test_match(script, is_bsd, output):
command = Command(script, output)
def test_match(script, is_bsd):
command = Command(script, output(is_bsd))
assert match(command)
@@ -29,7 +27,7 @@ def test_not_match(command):
@pytest.mark.parametrize('script, is_bsd', [
('touch /a/b/c', False),
('touch /a/b/c', True)])
def test_get_new_command(script, is_bsd, output):
command = Command(script, output)
def test_get_new_command(script, is_bsd):
command = Command(script, output(is_bsd))
fixed_command = get_new_command(command)
assert fixed_command == 'mkdir -p /a/b && touch /a/b/c'