From 596f59f471a4040fa24be02d22dbdd8805d30dac Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Dec 2022 21:18:16 -0500 Subject: [PATCH] tests: Maybe skip introspection tests If we don't find the python gi module, skip the introspection test. --- testsuite/introspection/api.py | 5 ++++- testsuite/introspection/meson.build | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py index a2feac37ea..9bbbedfe13 100755 --- a/testsuite/introspection/api.py +++ b/testsuite/introspection/api.py @@ -14,7 +14,10 @@ if hasattr(os, 'add_dll_directory'): if path != '' and os.path.isdir(path): os.add_dll_directory(path) -import gi +try: + import gi +except ImportError: + sys.exit(77) # skip this test, gi module is not available gi.require_version('Gtk', '4.0') diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build index c64a0f54d3..a30c687353 100644 --- a/testsuite/introspection/meson.build +++ b/testsuite/introspection/meson.build @@ -1,5 +1,3 @@ -py = import('python').find_installation('python3', modules: ['gi']) - env = environment() env.prepend('GI_TYPELIB_PATH', project_build_root / 'gtk',