classification
Title: DeprecationWarning in test_enum over formatting
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brandonschabell, dlax, ethan.furman, lukasz.langa, xtreak
Priority: normal Keywords: newcomer friendly, patch

Created on 2021-07-05 04:24 by xtreak, last changed 2021-08-04 19:04 by lukasz.langa. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27090 merged brandonschabell, 2021-07-12 00:48
Messages (4)
msg396967 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-07-05 04:24
It seems the line above this is wrapped under a block to check for deprecation warning but this line got missed out.

PYTHONWARNINGS=always ./python.exe -Wall -m test test_enum
0:00:00 load avg: 3.91 Run tests sequentially
0:00:00 load avg: 3.91 [1/1] test_enum
/Users/kasingar/stuff/python/cpython/Lib/test/test_enum.py:2324: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value;
use a format specifier, such as :d for an integer-based Enum, to maintain the current display
  self.assertEqual(OkayEnum.one, '{}'.format(OkayEnum.one))

== Tests result: SUCCESS ==

1 test OK.

Total duration: 257 ms
Tests result: SUCCESS
msg398463 - (view) Author: Denis Laxalde (dlax) * Date: 2021-07-29 07:24
The assertion at stake looks redundant since we already check that `'{}'.format(OkayEnum.one) == '1'` (the line above) and that `OkayEnum.one == '1'` (3 lines above).
msg398936 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-04 19:01
New changeset f99c015638b46e46ae3ee3f27b96a514007cdaef by Brandon Schabell in branch 'main':
bpo-44564 Move formatted assertion under deprecation warning context (GH-27090)
https://github.com/python/cpython/commit/f99c015638b46e46ae3ee3f27b96a514007cdaef
msg398939 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-04 19:04
Thanks, Brandon! ✨ 🍰 ✨
History
Date User Action Args
2021-08-04 19:04:28lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg398939

stage: patch review -> resolved
2021-08-04 19:01:41lukasz.langasetnosy: + lukasz.langa
messages: + msg398936
2021-07-31 18:30:36iritkatriellinkissue44798 superseder
2021-07-29 07:24:15dlaxsetnosy: + dlax
messages: + msg398463
2021-07-12 00:48:58brandonschabellsetkeywords: + patch
nosy: + brandonschabell

pull_requests: + pull_request25638
stage: patch review
2021-07-05 04:24:06xtreakcreate