From 672ce99b0cb100fc8945fcbd3d404df075d90d94 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Mon, 30 Aug 2021 16:49:24 -0600 Subject: [PATCH] mgr/cephadm: add asyncmock to python venv for running unittests on python <= 3.8 Signed-off-by: Michael Fritch --- src/pybind/mgr/cephadm/tests/test_cephadm.py | 5 ++++- src/pybind/mgr/requirements.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 93cf942085df6..c2e845351487a 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 ccc3b1f414f78..27e791f6c931d 100644 --- a/src/pybind/mgr/requirements.txt +++ b/src/pybind/mgr/requirements.txt @@ -8,3 +8,4 @@ pyOpenSSL Jinja2 pyfakefs asyncssh +asyncmock -- 2.39.5