mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix test_postgresql dependency analysis.
This commit is contained in:
parent
b71133eeb5
commit
272bb8da7a
1 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,12 @@ class TestPostgres(unittest.TestCase):
|
||||||
if mod in sys.modules:
|
if mod in sys.modules:
|
||||||
del sys.modules[mod]
|
del sys.modules[mod]
|
||||||
|
|
||||||
|
def test_import(self):
|
||||||
|
# this import makes dependency analysis work so the tests will run when the module_utils change
|
||||||
|
from ansible.module_utils.postgres import HAS_PSYCOPG2
|
||||||
|
|
||||||
|
assert HAS_PSYCOPG2 is not None
|
||||||
|
|
||||||
@patch.object(builtins, '__import__')
|
@patch.object(builtins, '__import__')
|
||||||
def test_postgres_pg2_missing_ensure_libs(self, mock_import):
|
def test_postgres_pg2_missing_ensure_libs(self, mock_import):
|
||||||
def _mock_import(name, *args, **kwargs):
|
def _mock_import(name, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue