Skip to content

Commit 8ff4559

Browse files
committed
Adding working (and not working) tests for issue
1 parent 3c5615a commit 8ff4559

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_enum.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,18 @@ def test_converstion_enum():
6262
assert m.test_conversion_enum(m.ConversionEnum.Convert1) == "ConversionEnum::Convert1"
6363
assert m.test_conversion_enum(m.ConversionEnum("Convert1")) == "ConversionEnum::Convert1"
6464
assert m.test_conversion_enum("Convert1") == "ConversionEnum::Convert1"
65-
assert m.test_conversion_enum(m.ConversionEnum.Convert1) == "ConversionEnum::Convert1"
65+
66+
67+
def test_conversion_enum_raises():
68+
with pytest.raises(ValueError) as excinfo:
69+
m.ConversionEnum("Convert0")
70+
assert str(excinfo.value) == "\"Convert0\" is not a valid value for enum type ConversionEnum"
71+
72+
73+
def test_conversion_enum_raises_implicit():
74+
with pytest.raises(ValueError) as excinfo:
75+
m.test_conversion_enum("Convert0")
76+
assert str(excinfo.value) == "\"Convert0\" is not a valid value for enum type ConversionEnum"
6677

6778

6879
def test_scoped_enum():

0 commit comments

Comments
 (0)