avoid tests when ncclient is not installed
This commit is contained in:
parent
c0de93310f
commit
d3d812b604
2 changed files with 6 additions and 1 deletions
|
@ -21,6 +21,7 @@ __metaclass__ = type
|
|||
|
||||
from io import StringIO
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
from ansible.compat.tests import mock
|
||||
from ansible.compat.tests import unittest
|
||||
|
@ -43,8 +44,9 @@ from ansible.plugins.connection.docker import Connection as DockerConnection
|
|||
from ansible.plugins.connection.network_cli import Connection as NetworkCliConnection
|
||||
from ansible.plugins.connection.httpapi import Connection as HttpapiConnection
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
pytest.importorskip("ncclient")
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
builtin_import = __import__
|
||||
|
||||
mock_ncclient = MagicMock(name='ncclient')
|
||||
|
|
|
@ -23,6 +23,7 @@ __metaclass__ = type
|
|||
import sys
|
||||
import re
|
||||
import json
|
||||
import pytest
|
||||
|
||||
from io import StringIO
|
||||
|
||||
|
@ -31,6 +32,8 @@ from ansible.compat.tests.mock import patch, MagicMock, PropertyMock
|
|||
from ansible.errors import AnsibleConnectionFailure
|
||||
from ansible.playbook.play_context import PlayContext
|
||||
|
||||
pytest.importorskip("ncclient")
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
builtin_import = __import__
|
||||
|
|
Loading…
Reference in a new issue