aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-08-08 13:08:30 -0700
committerEli Schwartz <eschwartz93@gmail.com>2022-08-17 16:25:36 -0400
commite062dcdfcc48685c99ecf1c4df891a044f21fefe (patch)
treee1b3da1477470d253000f1635213312bb8e41a01 /unittests
parent369c2660d017ba662b14c443170ff35678b283fd (diff)
downloadmeson-e062dcdfcc48685c99ecf1c4df891a044f21fefe.zip
meson-e062dcdfcc48685c99ecf1c4df891a044f21fefe.tar.gz
meson-e062dcdfcc48685c99ecf1c4df891a044f21fefe.tar.bz2
allplatformstests: use subTests with test_warning_location
Diffstat (limited to 'unittests')
-rw-r--r--unittests/allplatformstests.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 224f7ca..745e67b 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -1932,21 +1932,23 @@ class AllPlatformTests(BasePlatformTests):
r'meson.build:7: WARNING: Module unstable-simd has no backwards or forwards compatibility and might not exist in future releases.',
r"meson.build:11: WARNING: The variable(s) 'MISSING' in the input file 'conf.in' are not present in the given configuration data.",
]:
- self.assertRegex(out, re.escape(expected))
+ with self.subTest(expected):
+ self.assertRegex(out, re.escape(expected))
for wd in [
self.src_root,
self.builddir,
os.getcwd(),
]:
- self.new_builddir()
- out = self.init(tdir, workdir=wd)
- expected = os.path.join(relpath(tdir, self.src_root), 'meson.build')
- relwd = relpath(self.src_root, wd)
- if relwd != '.':
- expected = os.path.join(relwd, expected)
- expected = '\n' + expected + ':'
- self.assertIn(expected, out)
+ with self.subTest(wd):
+ self.new_builddir()
+ out = self.init(tdir, workdir=wd)
+ expected = os.path.join(relpath(tdir, self.src_root), 'meson.build')
+ relwd = relpath(self.src_root, wd)
+ if relwd != '.':
+ expected = os.path.join(relwd, expected)
+ expected = '\n' + expected + ':'
+ self.assertIn(expected, out)
def test_error_location_path(self):
'''Test locations in meson errors contain correct paths'''