1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-20 01:28:56 +00:00

Skip test instead of failing if go executable is not found.

This commit is contained in:
Kartik Soneji 2020-07-20 08:12:05 +05:30
parent c196e2901c
commit efa1041089

View File

@ -1,6 +1,7 @@
import pytest import pytest
from thefuck.rules.go_unknown_command import match, get_new_command from thefuck.rules.go_unknown_command import match, get_new_command
from thefuck.types import Command from thefuck.types import Command
from thefuck.utils import which
@pytest.fixture @pytest.fixture
@ -17,5 +18,6 @@ def test_not_match():
assert not match(Command('go run', 'go run: no go files listed')) assert not match(Command('go run', 'go run: no go files listed'))
@pytest.mark.skipif(not which('go'), reason='Skip if go executable not found')
def test_get_new_command(build_misspelled_output): def test_get_new_command(build_misspelled_output):
assert get_new_command(Command('go bulid', build_misspelled_output)) == 'go build' assert get_new_command(Command('go bulid', build_misspelled_output)) == 'go build'