Last active
November 16, 2018 00:35
-
-
Save behnam/0d0906f4cf910221299ab684a5bf31ac to your computer and use it in GitHub Desktop.
snapshottest.sorted_dict.SortedDict only accepts string dict keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enum | |
import collections | |
import snapshottest | |
class Fruit(enum.Enum): | |
APPLE = 1 | |
ORANGE = 2 | |
test_value = { | |
Fruit.APPLE: 100, | |
Fruit.ORANGE: 400, | |
} | |
# This works fine... | |
collections.OrderedDict(**test_value) | |
# But this throws: | |
# ``` | |
# TypeError: __init__() keywords must be strings | |
# ``` | |
snapshottest.sorted_dict.SortedDict(**test_value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://repl.it/repls/TiredQuerulousTrapezoids