avoid tests when ncclient is not installed

pull/44123/merge
Brian Coca 6 years ago committed by Brian Coca
parent c0de93310f
commit d3d812b604

@ -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…
Cancel
Save