aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-09-02 14:37:51 -0700
committerXavier Claessens <xclaesse@gmail.com>2022-09-22 18:17:43 -0400
commit1917b9253e70ae3469b97673f479d54d37b3b881 (patch)
tree0a62b50d0107354ad358eb12a80acd2a4b2ca39c /unittests
parent30b17746280d34fae71714ef6081e4a5a33c70a7 (diff)
downloadmeson-1917b9253e70ae3469b97673f479d54d37b3b881.zip
meson-1917b9253e70ae3469b97673f479d54d37b3b881.tar.gz
meson-1917b9253e70ae3469b97673f479d54d37b3b881.tar.bz2
modules/gnome: make_native_glib_version an instance var
This removes the need for the use of the global statement. I've also updated the test that overrides this to use mock.patch instead of hand monkey patching.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/linuxliketests.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
index 69e4c6f..7de3214 100644
--- a/unittests/linuxliketests.py
+++ b/unittests/linuxliketests.py
@@ -1082,15 +1082,12 @@ class LinuxlikeTests(BasePlatformTests):
also tested.
'''
testdir = os.path.join(self.framework_test_dir, '7 gnome')
- mesonbuild.modules.gnome.native_glib_version = '2.20'
- env = {'MESON_UNIT_TEST_PRETEND_GLIB_OLD': "1"}
- try:
+ with mock.patch('mesonbuild.modules.gnome.GnomeModule._get_native_glib_version', mock.Mock(return_value='2.20')):
+ env = {'MESON_UNIT_TEST_PRETEND_GLIB_OLD': "1"}
self.init(testdir,
inprocess=True,
override_envvars=env)
self.build(override_envvars=env)
- finally:
- mesonbuild.modules.gnome.native_glib_version = None
@skipIfNoPkgconfig
def test_pkgconfig_usage(self):