]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46296: [Enum] add a test for missing `value` recovery (GH-30458)
authorNikita Sobolev <mail@sobolevn.me>
Fri, 7 Jan 2022 21:44:21 +0000 (00:44 +0300)
committerGitHub <noreply@github.com>
Fri, 7 Jan 2022 21:44:21 +0000 (13:44 -0800)
commit74d1663580d1914bd110c3ab7282451f5e2cd2b5
tree0f2c442a8c18ada0102701bd3adaa8a27f04c7cc
parentd382f7ee0b98e4ab6ade9384268f25c06be462ad
bpo-46296: [Enum] add a test for missing `value` recovery (GH-30458)

In `__set_name__` there is a check for the `_value_` attribute and an attempt to add it if missing; this adds a test to cover the case for simple enums with a custom `__new__` method.
Lib/test/test_enum.py
Misc/NEWS.d/next/Tests/2022-01-08-00-00-38.bpo-46296.vqxgTm.rst [new file with mode: 0644]