aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-03-04 13:04:24 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-03-05 09:58:52 -0800
commit581d69a8d3a726dea06e8bf0cd18bb901692b56f (patch)
treea35887377e1967b4d9fb2f9280e8d3bd410e4cb1 /run_unittests.py
parentb231ff36df8e5cb21fa41a6380516c6cf5bf9c4e (diff)
downloadmeson-581d69a8d3a726dea06e8bf0cd18bb901692b56f.zip
meson-581d69a8d3a726dea06e8bf0cd18bb901692b56f.tar.gz
meson-581d69a8d3a726dea06e8bf0cd18bb901692b56f.tar.bz2
remove ability to pass multiple keys to extract_as_list
This makes the typing annotations basically impossible to get right, but if we only have one key then it's easy. Fortunately python provides comprehensions, so we don't even need the ability to pass multiple keys, we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and get the same result.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/run_unittests.py b/run_unittests.py
index b39ba28..adfd927 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -706,17 +706,15 @@ class InternalTests(unittest.TestCase):
self.assertEqual(kwargs, {'sources': [1, 2, 3]})
self.assertEqual([1, 2, 3], extract(kwargs, 'sources', pop=True))
self.assertEqual(kwargs, {})
+
# Test unholding
holder3 = ObjectHolder(3)
kwargs = {'sources': [1, 2, holder3]}
self.assertEqual(kwargs, {'sources': [1, 2, holder3]})
- # Test listification
- kwargs = {'sources': [1, 2, 3], 'pch_sources': [4, 5, 6]}
- self.assertEqual([[1, 2, 3], [4, 5, 6]], extract(kwargs, 'sources', 'pch_sources'))
# flatten nested lists
kwargs = {'sources': [1, [2, [3]]]}
- self.assertEqual([1, 2, 3], extract(kwargs, 'sources', flatten=True))
+ self.assertEqual([1, 2, 3], extract(kwargs, 'sources'))
def test_pkgconfig_module(self):