| 244 | |
| 245 | |
| 246 | def test_char_underlying_enum(): # Issue #1331/PR #1334: |
| 247 | assert type(m.ScopedCharEnum.Positive.__int__()) is int |
| 248 | assert int(m.ScopedChar16Enum.Zero) == 0 |
| 249 | assert hash(m.ScopedChar32Enum.Positive) == 1 |
| 250 | assert type(m.ScopedCharEnum.Positive.__getstate__()) is int |
| 251 | assert m.ScopedWCharEnum(1) == m.ScopedWCharEnum.Positive |
| 252 | with pytest.raises(TypeError): |
| 253 | # Even if the underlying type is char, only an int can be used to construct the enum: |
| 254 | m.ScopedCharEnum("0") |
| 255 | |
| 256 | |
| 257 | def test_bool_underlying_enum(): |