]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
functional: always enable all python warnings
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 15 Jul 2025 14:30:19 +0000 (15:30 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 21 Jul 2025 05:58:57 +0000 (07:58 +0200)
Of most importance is that this gives us a heads-up if anything
we rely on has been deprecated. The default python behaviour
only emits a warning if triggered from __main__ which is very
limited.

Setting the env variable further ensures that any python child
processes will also display warnings.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250715143023.1851000-11-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/qemu_test/testcase.py

index 71c7160adcf8dd53d7de88f6f003ad15ef9a052c..2a78e735f1604f21efd18e38ee0d586496d6b38c 100644 (file)
@@ -19,6 +19,7 @@ import shutil
 from subprocess import run
 import sys
 import tempfile
+import warnings
 import unittest
 import uuid
 
@@ -235,6 +236,9 @@ class QemuBaseTest(unittest.TestCase):
         self._log_fh.close()
 
     def main():
+        warnings.simplefilter("default")
+        os.environ["PYTHONWARNINGS"] = "default"
+
         path = os.path.basename(sys.argv[0])[:-3]
 
         cache = os.environ.get("QEMU_TEST_PRECACHE", None)