summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-11-26 15:38:48 +1100
committerDamien George <damien.p.george@gmail.com>2016-11-26 15:38:48 +1100
commita31a3a9fd5f9f26bc9e06b7c682a9544f71806ad (patch)
treee75cf4bd412338866e3f2aa220fa9ba572aeb674 /tests
parentf8b71aabb4c53595d449e9b6f85f9ed35592ab12 (diff)
downloadmicropython-a31a3a9fd5f9f26bc9e06b7c682a9544f71806ad.tar.gz
micropython-a31a3a9fd5f9f26bc9e06b7c682a9544f71806ad.zip
tests/basics: Add test for dict.fromkeys where arg is a generator.
Improves coverage because it tests the case where the arg does not have a __len__ slot.
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/dict_fromkeys.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/basics/dict_fromkeys.py b/tests/basics/dict_fromkeys.py
index d03f6ae9d2..75451fb756 100644
--- a/tests/basics/dict_fromkeys.py
+++ b/tests/basics/dict_fromkeys.py
@@ -8,3 +8,6 @@ l = list(d.values())
l.sort()
print(l)
+# argument to fromkeys is a generator
+d = dict.fromkeys(i + 1 for i in range(1))
+print(d)