diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-04 13:04:24 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-05 09:58:52 -0800 |
| commit | 581d69a8d3a726dea06e8bf0cd18bb901692b56f (patch) | |
| tree | a35887377e1967b4d9fb2f9280e8d3bd410e4cb1 /run_unittests.py | |
| parent | b231ff36df8e5cb21fa41a6380516c6cf5bf9c4e (diff) | |
| download | meson-581d69a8d3a726dea06e8bf0cd18bb901692b56f.tar.gz | |
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-x | run_unittests.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/run_unittests.py b/run_unittests.py index b39ba2832..adfd92735 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): |
