From a8bf4fd569e22d1042542f9dc7d60c869e81f62f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 4 Oct 2026 02:03:37 +0900 Subject: [PATCH] Reuse test commands in cover target ... to maintain the commands in a single place. Also install coverage only when needed. Change-Id: I91298ba5a5d5221a9bcaf3bfe6cf1dab9f92c36d Signed-off-by: Takashi Kajinami --- test-requirements.txt | 1 - tox.ini | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 2717c199..82281ce0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,6 @@ mypy>=1.19.0 # MIT oslotest>=3.2.0 # Apache-2.0 testtools>=2.2.0 # MIT -coverage>=5.0 # Apache-2.0 jsonschema>=3.2.0 # MIT stestr>=2.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 77277d46..d236eb6a 100644 --- a/tox.ini +++ b/tox.ini @@ -35,9 +35,12 @@ commands = {posargs} [testenv:cover] setenv = PYTHON=coverage run --source oslo_versionedobjects --parallel-mode +deps = + {[testenv]deps} + coverage>=5.0 # Apache-2.0 commands = coverage erase - stestr run {posargs} + {[testenv]commands} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml