classification
Title: unittest: Add assertUniqeIn
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, rousseldenis, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2021-01-26 09:30 by rousseldenis, last changed 2021-01-29 20:01 by rousseldenis. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24336 closed rousseldenis, 2021-01-26 09:31
Messages (6)
msg385700 - (view) Author: Denis Roussel (rousseldenis) * Date: 2021-01-26 09:30
Allows to test uniqueness of members of a list
msg385894 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-01-29 04:49
-0 on this one because the algorithm is quadratic, the name is opaque, and because the common case can already be clearly expressed with sets.
msg385895 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-01-29 06:58
It looks pretty niche. I do not remember a single case in which such method would help.
msg385905 - (view) Author: Denis Roussel (rousseldenis) * Date: 2021-01-29 10:28
Indeed, can do 
assertNotEquals(len(the_list), len(set(the_list))
msg385929 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-01-29 19:59
I think you meant assertEqual(len(alist), len(set(alist))).  I agree with others.
msg385930 - (view) Author: Denis Roussel (rousseldenis) * Date: 2021-01-29 20:01
Of course. Wanted a shortcut. Can close it if you want.
History
Date User Action Args
2021-01-29 20:01:24rousseldenissetmessages: + msg385930
2021-01-29 19:59:44terry.reedysetstatus: open -> closed

type: enhancement
versions: + Python 3.10
nosy: + terry.reedy

messages: + msg385929
resolution: rejected
stage: patch review -> resolved
2021-01-29 10:28:41rousseldenissetmessages: + msg385905
2021-01-29 06:58:24serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg385895
2021-01-29 04:49:24rhettingersetnosy: + rhettinger
messages: + msg385894
2021-01-26 09:31:44rousseldenissetkeywords: + patch
stage: patch review
pull_requests: + pull_request23154
2021-01-26 09:30:56rousseldeniscreate