Преглед на файлове

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.
Marek Marczykowski-Górecki преди 5 години
родител
ревизия
7a607e3731
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      qubes/tests/__init__.py

+ 3 - 0
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()