From 7a607e3731edbdacdac7ffb8de80c67664f80d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 3 Oct 2018 22:40:38 +0200 Subject: [PATCH] tests: add QUBES_TEST_TEMPLATES env variable Allow easily list templates to be tested, without enumerating all the test classes. This is especially useful with nose2 runner which can't use load tests protocol _and_ select subset of tests. --- qubes/tests/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index e492eec1..b5637ddd 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -1143,6 +1143,9 @@ _templates = None def list_templates(): '''Returns tuple of template names available in the system.''' global _templates + if _templates is None: + if 'QUBES_TEST_TEMPLATES' in os.environ: + _templates = os.environ['QUBES_TEST_TEMPLATES'].split() if _templates is None: try: app = qubes.Qubes()