This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Deprecation warnings in test_cmd_line and test_collections
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, xtreak
Priority: normal Keywords: patch

Created on 2021-04-13 05:15 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25380 merged xtreak, 2021-04-13 05:17
Messages (5)
msg390923 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-04-13 05:15
Following deprecation warnings are raised when tests are ran with -Wall in CPython test suite. I will raise a PR for this.


0:03:48 load avg: 0.79 [ 59/427] test_cmd_line                                                                                                                          
/root/cpython/Lib/test/test_cmd_line.py:865: DeprecationWarning: invalid escape sequence \u                                                                             
  self.check_string(b"'\u1f'")

0:04:11 load avg: 0.86 [ 77/427] test_collections                                                                                                                       
/root/cpython/Lib/test/test_collections.py:1518: DeprecationWarning: Please use assertEqual instead.                                                                    
  self.assertEquals(len(s), len(items) - 1)
msg391063 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-14 11:44
Serhiy closed my issue bpo-43841 as a duplicate of this one. My message:

Does someone want to propose a fix?

$ ./python -m test -v test_collections 
(...)
test_issue_4920 (test.test_collections.TestCollectionABCs) ... /home/vstinner/python/master/Lib/test/test_collections.py:1518: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(len(s), len(items) - 1)
ok
(...)
Tests result: SUCCESS


Warning introduced by PR 25209:

commit 453074c8daf996b1815a0cd2218f0dbf1801056c
Author: Stepan Sindelar <me@stevesindelar.cz>
Date:   Thu Apr 8 01:31:55 2021 +0200

    Fix broken test for MutableSet.pop() (GH-25209)
    
    Changes the test to not assert concrete result of pop, but just that it
    was an item from the set, and that the set shrunk by one.
msg391064 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-14 11:45
New changeset b8509ffa82d393d9d4a0f5520edca057978bbd86 by Karthikeyan Singaravelan in branch 'master':
bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380)
https://github.com/python/cpython/commit/b8509ffa82d393d9d4a0f5520edca057978bbd86
msg391066 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-14 11:46
Thanks Karthikeyan! Usually, I let core developers to merge their own PRs, but I created multiple "easy" issues about warnings in tests, and so I merged directly your fix to prevent contributors to propose similar fixes ;-)
msg391068 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-14 11:48
I also created bpo-43839 "[easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u" which was closed as duplicate of this one.
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 87991
2021-04-14 11:48:01vstinnersetmessages: + msg391068
2021-04-14 11:46:55vstinnersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
title: [easy] test_collections: DeprecationWarning: Please use assertEqual instead -> Deprecation warnings in test_cmd_line and test_collections
2021-04-14 11:46:31vstinnersetmessages: + msg391066
2021-04-14 11:45:25vstinnersetmessages: + msg391064
2021-04-14 11:44:17vstinnersetnosy: + vstinner

messages: + msg391063
title: Deprecation warnings in test cases -> [easy] test_collections: DeprecationWarning: Please use assertEqual instead
2021-04-14 11:32:31serhiy.storchakalinkissue43841 superseder
2021-04-14 11:32:03serhiy.storchakalinkissue43839 superseder
2021-04-13 05:17:30xtreaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request24112
2021-04-13 05:15:15xtreakcreate