aboutsummaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-06-06 20:03:39 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-08-15 09:36:18 -0400
commitead4ba777785e1fa6a265b6597dc97a68d38f82e (patch)
tree1d50338ce32a46a0536e9f3610e3cb82f09f2e95 /unittests/allplatformstests.py
parent3340d373fba559dde43fffae9bb21be37bee7ff1 (diff)
downloadmeson-ead4ba777785e1fa6a265b6597dc97a68d38f82e.zip
meson-ead4ba777785e1fa6a265b6597dc97a68d38f82e.tar.gz
meson-ead4ba777785e1fa6a265b6597dc97a68d38f82e.tar.bz2
run_unittests: fix unused variable warnings
We don't actually want to do anything with the open()ed file, just immediately close it. The CalledProcessError doesn't have its return returncode checked here, even though other code with the same type of context manager does.
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r--unittests/allplatformstests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 6a405c1..92a9caf 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -538,7 +538,7 @@ class AllPlatformTests(BasePlatformTests):
def test_implicit_forcefallback(self):
testdir = os.path.join(self.unit_test_dir, '96 implicit force fallback')
- with self.assertRaises(subprocess.CalledProcessError) as cm:
+ with self.assertRaises(subprocess.CalledProcessError):
self.init(testdir)
self.init(testdir, extra_args=['--wrap-mode=forcefallback'])
self.new_builddir()
@@ -3605,7 +3605,7 @@ class AllPlatformTests(BasePlatformTests):
cmakefile = Path(testdir) / 'subprojects' / 'sub2' / 'CMakeLists.txt'
self.init(testdir)
self.build()
- with cmakefile.open('a', encoding='utf-8') as f:
+ with cmakefile.open('a', encoding='utf-8'):
os.utime(str(cmakefile))
self.assertReconfiguredBuildIsNoop()