From: Michael Fritch Date: Mon, 30 Aug 2021 22:49:24 +0000 (-0600) Subject: mgr/cephadm: add asyncmock to python venv X-Git-Tag: v17.1.0~970^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=672ce99b0cb100fc8945fcbd3d404df075d90d94;p=ceph.git mgr/cephadm: add asyncmock to python venv for running unittests on python <= 3.8 Signed-off-by: Michael Fritch --- diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 93cf942085df..c2e845351487 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -3,7 +3,10 @@ try: # AsyncMock was not added until python 3.8 from unittest.mock import AsyncMock except ImportError: - pass + from asyncmock import AsyncMock +except ImportError: + AsyncMock = None + from contextlib import contextmanager import pytest diff --git a/src/pybind/mgr/requirements.txt b/src/pybind/mgr/requirements.txt index ccc3b1f414f7..27e791f6c931 100644 --- a/src/pybind/mgr/requirements.txt +++ b/src/pybind/mgr/requirements.txt @@ -8,3 +8,4 @@ pyOpenSSL Jinja2 pyfakefs asyncssh +asyncmock