[elbe-devel] [PATCH 19/37] Set mandatory global variable
Eduard Krein
eduard.krein at linutronix.de
Wed Feb 7 16:15:16 CET 2024
Am 07.02.2024 um 15:28 schrieb Benedikt Spranger:
> The global variable elbe_dir is mandatory to set before calling
> elbepack modules.
>
> From 'elbepack/directories.py':
> "set global variables that are used in other modules via imports
> this is the very first function that is called by 'elbe'"
>
> Set elbe_dir in the test environment.
>
> Signed-off-by: Benedikt Spranger <b.spranger at linutronix.de>
Reviewed-by: Eduard Krein<eduard.krein at linutronix.de>
> ---
> elbepack/tests/test_preproc.py | 3 +++
> elbepack/tests/test_pylint.py | 3 +++
> elbepack/tests/test_xml.py | 3 +++
> 3 files changed, 9 insertions(+)
>
> diff --git a/elbepack/tests/test_preproc.py b/elbepack/tests/test_preproc.py
> index d623368c..d4b99232 100644
> --- a/elbepack/tests/test_preproc.py
> +++ b/elbepack/tests/test_preproc.py
> @@ -10,6 +10,9 @@ from elbepack.directories import elbe_exe, elbe_dir
>
>
> class TestPreproc(ElbeTestCase):
> + global elbe_dir #pylint: disable=global-statement
> +
> + elbe_dir = os.path.join(os.path.dirname(__file__), "../..")
>
> failure_set = {os.path.join(elbe_dir, path)
> for path
> diff --git a/elbepack/tests/test_pylint.py b/elbepack/tests/test_pylint.py
> index 7338f262..64cac9a6 100644
> --- a/elbepack/tests/test_pylint.py
> +++ b/elbepack/tests/test_pylint.py
> @@ -10,6 +10,9 @@ from elbepack.directories import pack_dir, elbe_exe, elbe_dir
>
>
> class TestPylint(ElbeTestCase):
> + global elbe_dir #pylint: disable=global-statement
> +
> + elbe_dir = os.path.join(os.path.dirname(__file__), "../..")
>
> pylint_opts = ["--reports=n",
> "--score=n",
> diff --git a/elbepack/tests/test_xml.py b/elbepack/tests/test_xml.py
> index 915ea16d..fed49e05 100644
> --- a/elbepack/tests/test_xml.py
> +++ b/elbepack/tests/test_xml.py
> @@ -14,6 +14,9 @@ from elbepack.commands.test import ElbeTestCase, ElbeTestLevel, system
> @unittest.skipIf(ElbeTestCase.level < ElbeTestLevel.INITVM,
> "Test level not set to INITVM")
> class TestSimpleXML(ElbeTestCase):
> + global elbe_dir #pylint: disable=global-statement
> +
> + elbe_dir = os.path.join(os.path.dirname(__file__), "../..")
>
> params = [os.path.join(elbe_dir, "tests", fname)
> for fname
--
Eduard Krein
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 19; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/legal/data-protection.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger,
Thomas Gleixner, Sharon Heck, Yulia Beck, Tiffany Silva
More information about the elbe-devel
mailing list