diff options
author | Damien George <damien.p.george@gmail.com> | 2016-11-26 15:38:48 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-26 15:38:48 +1100 |
commit | a31a3a9fd5f9f26bc9e06b7c682a9544f71806ad (patch) | |
tree | e75cf4bd412338866e3f2aa220fa9ba572aeb674 /tests | |
parent | f8b71aabb4c53595d449e9b6f85f9ed35592ab12 (diff) | |
download | micropython-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.py | 3 |
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) |