Skip to content
Snippets Groups Projects
Commit e890b1e1e1c5 authored by Michał Górny's avatar Michał Górny
Browse files

Skip tests requiring invoke if it's not installed

Since invoke is an optional dependency and only one group of tests
require it, skip them gracefully rather than failing if it's not
present.
parent 072a3a87ec53
No related branches found
No related tags found
No related merge requests found
...@@ -6,4 +6,5 @@ ...@@ -6,4 +6,5 @@
from paramiko.py3compat import string_types from paramiko.py3compat import string_types
try:
from invoke import Result from invoke import Result
...@@ -9,4 +10,7 @@ ...@@ -9,4 +10,7 @@
from invoke import Result from invoke import Result
except ImportError:
Result = None
from mock import patch from mock import patch
from pytest import raises, mark, fixture from pytest import raises, mark, fixture
...@@ -705,6 +709,7 @@ ...@@ -705,6 +709,7 @@
return inner return inner
@mark.skipif(Result is None, reason="requires invoke package")
class TestMatchExec(object): class TestMatchExec(object):
@patch("paramiko.config.invoke", new=None) @patch("paramiko.config.invoke", new=None)
@patch("paramiko.config.invoke_import_error", new=ImportError("meh")) @patch("paramiko.config.invoke_import_error", new=ImportError("meh"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment