aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-11-27 22:33:15 +0200
committerGitHub <noreply@github.com>2021-11-27 22:33:15 +0200
commit11e26a0fa9fed90d4720f1c87de2c9987f5e657c (patch)
tree7f259ddb22472733389b0ecdbe745f69daab0b74 /unittests
parentd014ccf8d79a55e64c3c8ea6ffe0a3ffaa183a37 (diff)
parentd412f0aff570933903fb2eba7093191138ecf94a (diff)
downloadmeson-11e26a0fa9fed90d4720f1c87de2c9987f5e657c.zip
meson-11e26a0fa9fed90d4720f1c87de2c9987f5e657c.tar.gz
meson-11e26a0fa9fed90d4720f1c87de2c9987f5e657c.tar.bz2
Merge pull request #9599 from dcbaker/submit/typed_kwargs-message-improvements
Improve error messages for typed_kwarg type mismatches in containers
Diffstat (limited to 'unittests')
-rw-r--r--unittests/internaltests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index 47d486e..c4fd0a6 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -1267,7 +1267,7 @@ class InternalTests(unittest.TestCase):
with self.assertRaises(InvalidArguments) as cm:
_(None, mock.Mock(), [], {'input': {}})
- self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type 'dict' but should have been list[str]")
+ self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type dict[] but should have been array[str]")
def test_typed_kwarg_contained_invalid(self) -> None:
@typed_kwargs(
@@ -1278,8 +1278,8 @@ class InternalTests(unittest.TestCase):
self.assertTrue(False) # should be unreachable
with self.assertRaises(InvalidArguments) as cm:
- _(None, mock.Mock(), [], {'input': {'key': 1}})
- self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type 'dict' but should have been dict[str]")
+ _(None, mock.Mock(), [], {'input': {'key': 1, 'bar': 2}})
+ self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type dict[int] but should have been dict[str]")
def test_typed_kwarg_container_listify(self) -> None:
@typed_kwargs(
@@ -1314,7 +1314,7 @@ class InternalTests(unittest.TestCase):
with self.assertRaises(MesonException) as cm:
_(None, mock.Mock(), [], {'input': ['a']})
- self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type 'list' but should have been list[str] that has even size")
+ self.assertEqual(str(cm.exception), "testfunc keyword argument 'input' was of type array[str] but should have been array[str] that has even size")
@mock.patch.dict(mesonbuild.mesonlib.project_meson_versions, {})
def test_typed_kwarg_since(self) -> None: