| 255 | |
| 256 | |
| 257 | def test_bool_underlying_enum(): |
| 258 | assert type(m.ScopedBoolEnum.TRUE.__int__()) is int |
| 259 | assert int(m.ScopedBoolEnum.FALSE) == 0 |
| 260 | assert hash(m.ScopedBoolEnum.TRUE) == 1 |
| 261 | assert type(m.ScopedBoolEnum.TRUE.__getstate__()) is int |
| 262 | assert m.ScopedBoolEnum(1) == m.ScopedBoolEnum.TRUE |
| 263 | # Enum could construct with a bool |
| 264 | # (bool is a strict subclass of int, and False will be converted to 0) |
| 265 | assert m.ScopedBoolEnum(False) == m.ScopedBoolEnum.FALSE |
| 266 | |
| 267 | |
| 268 | def test_docstring_signatures(): |