aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-12-01 15:45:48 -0800
committerEli Schwartz <eschwartz93@gmail.com>2021-12-06 20:06:14 -0500
commit82136da933f0859edd6cf168a129ede706e9e055 (patch)
treee37ead97fcbf2351941bb311dddee5487453b449 /unittests
parent7191b6dab2b310adb93238bac804008e9c9757b8 (diff)
downloadmeson-82136da933f0859edd6cf168a129ede706e9e055.zip
meson-82136da933f0859edd6cf168a129ede706e9e055.tar.gz
meson-82136da933f0859edd6cf168a129ede706e9e055.tar.bz2
interpreterbase/decorators: Fix types of deprecated_values and since_values
Which shouldn't be Dict[str, str], they should be Dict[_T, str], as nay value that can be passed to types is valid here.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/internaltests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index c4fd0a6..4135655 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -1378,6 +1378,7 @@ class InternalTests(unittest.TestCase):
'testfunc',
KwargInfo('input', ContainerTypeInfo(list, str), listify=True, default=[], deprecated_values={'foo': '0.9'}, since_values={'bar': '1.1'}),
KwargInfo('output', ContainerTypeInfo(dict, str), default={}, deprecated_values={'foo': '0.9'}, since_values={'bar': '1.1'}),
+ KwargInfo('install_dir', (bool, str, NoneType), deprecated_values={False: '0.9'}),
KwargInfo(
'mode',
(str, type(None)),
@@ -1403,6 +1404,10 @@ class InternalTests(unittest.TestCase):
self.assertRegex(out.getvalue(), r"""WARNING:.Project targeting '1.0'.*deprecated since '0.9': "testfunc" keyword argument "output" value "foo".*""")
with mock.patch('sys.stdout', io.StringIO()) as out:
+ _(None, mock.Mock(subproject=''), [], {'install_dir': False})
+ self.assertRegex(out.getvalue(), r"""WARNING:.Project targeting '1.0'.*deprecated since '0.9': "testfunc" keyword argument "install_dir" value "False".*""")
+
+ with mock.patch('sys.stdout', io.StringIO()) as out:
_(None, mock.Mock(subproject=''), [], {'output': {'bar': 'b'}})
self.assertRegex(out.getvalue(), r"""WARNING:.Project targeting '1.0'.*introduced in '1.1': "testfunc" keyword argument "output" value "bar".*""")