From 836f6eeac50a25346df26a799b8f6b76b5ab2316 Mon Sep 17 00:00:00 2001 From: Kartik Soneji Date: Tue, 3 Nov 2020 23:00:03 +0530 Subject: [PATCH] Skip test instead of failing if go executable is not found. (#1117) --- tests/rules/test_go_unknown_command.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/rules/test_go_unknown_command.py b/tests/rules/test_go_unknown_command.py index b2456540..c3cd34b7 100644 --- a/tests/rules/test_go_unknown_command.py +++ b/tests/rules/test_go_unknown_command.py @@ -1,6 +1,7 @@ import pytest from thefuck.rules.go_unknown_command import match, get_new_command from thefuck.types import Command +from thefuck.utils import which @pytest.fixture @@ -17,5 +18,6 @@ def test_not_match(): 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): assert get_new_command(Command('go bulid', build_misspelled_output)) == 'go build'