tests/functional: set 'qemu_bin' as an object level field

The 'qemu_bin' field is currently set on the class, despite being
accessed as if it were an object instance field with 'self.qemu_bin'.

This is no obvious need to have it as a class field, so move it into
the object instance.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250228102738.3064045-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2025-02-28 10:27:33 +00:00 committed by Thomas Huth
parent 6c5a1467f8
commit 8188356a26
2 changed files with 2 additions and 2 deletions

View file

@ -173,7 +173,7 @@ QEMU binary selection
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
The QEMU binary used for the ``self.vm`` QEMUMachine instance will The QEMU binary used for the ``self.vm`` QEMUMachine instance will
primarily depend on the value of the ``qemu_bin`` class attribute. primarily depend on the value of the ``qemu_bin`` instance attribute.
If it is not explicitly set by the test code, its default value will If it is not explicitly set by the test code, its default value will
be the result the QEMU_TEST_QEMU_BINARY environment variable. be the result the QEMU_TEST_QEMU_BINARY environment variable.

View file

@ -33,7 +33,6 @@ from .uncompress import uncompress
class QemuBaseTest(unittest.TestCase): class QemuBaseTest(unittest.TestCase):
qemu_bin = os.getenv('QEMU_TEST_QEMU_BINARY')
arch = None arch = None
workdir = None workdir = None
@ -193,6 +192,7 @@ class QemuBaseTest(unittest.TestCase):
return True return True
def setUp(self): def setUp(self):
self.qemu_bin = os.getenv('QEMU_TEST_QEMU_BINARY')
self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be set') self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be set')
self.arch = self.qemu_bin.split('-')[-1] self.arch = self.qemu_bin.split('-')[-1]
self.socketdir = None self.socketdir = None