Skip to content

Commit 8054739

Browse files
committed
Add xfailed test for UintEnum as int
1 parent 9c2ec32 commit 8054739

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test_enum.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class _MyEnum(UintEnum):
2020
assert len(_MyEnum) == 2
2121
assert _MyEnum.__members__ == {"A": Uint(1), "B": Uint(2)}
2222

23+
actual = _MyEnum(Uint(1))
24+
assert actual is _MyEnum.A
2325

26+
27+
@pytest.mark.xfail(strict=True, reason="see ethereum/ethereum-types#21")
2428
def test_subclass_cast() -> None:
2529
class _MyEnum(UintEnum):
2630
A = 1
@@ -32,6 +36,9 @@ class _MyEnum(UintEnum):
3236
assert isinstance(_MyEnum.B, Uint)
3337
assert _MyEnum.B == Uint(2)
3438

39+
actual = _MyEnum(Uint(1))
40+
assert actual is _MyEnum.A
41+
3542

3643
def test_auto() -> None:
3744
class _MyEnum(UintEnum):

0 commit comments

Comments
 (0)