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: Some asserts in test_filecmp have the wrong messages
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: Steven.Barker, berker.peksag, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2014-05-06 07:43 by Steven.Barker, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
filecmp_test_messages.diff Steven.Barker, 2014-05-06 07:43 review
Messages (3)
msg217970 - (view) Author: Steven Barker (Steven.Barker) * Date: 2014-05-06 07:43
While working on a fix for issue 1234674, I found that the first test method in Lib/test/test_filecmp.py (FileCompareTestCase.test_matching) has switched up messages in its AssertEquals calls. The first two asserts have the message that should belong to the second two, and visa versa.

I've prepared a very simple patch that switches around the AssertEquals arguments so that the messages match what is being tested. The behavior checked by the asserts remains exactly the same, only the message printed if an assert fails will be different.

The test still passes. If you want to see the wrong message get displayed, the patch I uploaded for issue 1234674 may cause the test edited here to fail intermittently (it depend on whether two files are created in a shorter time than your filesystems's mtime resolution in the setup code). The failures are not affected by this patch, but with it you'll get the right message rather than a wrong one.
msg225290 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-14 05:34
New changeset b4bfd98a17c5 by Berker Peksag in branch '3.4':
Issue #21445: Pass exception messages correctly to assertTrue in
http://hg.python.org/cpython/rev/b4bfd98a17c5

New changeset 07ec9ec385de by Berker Peksag in branch 'default':
Issue #21445: Pass exception messages correctly to assertTrue in
http://hg.python.org/cpython/rev/07ec9ec385de
msg225291 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-08-14 05:37
Thanks for the patch, Steven.
History
Date User Action Args
2022-04-11 14:58:03adminsetgithub: 65644
2014-08-14 05:37:20berker.peksagsetstatus: open -> closed

nosy: + r.david.murray
messages: + msg225291

resolution: fixed
stage: commit review -> resolved
2014-08-14 05:34:55python-devsetnosy: + python-dev
messages: + msg225290
2014-08-14 05:18:18berker.peksagsetassignee: berker.peksag

nosy: + berker.peksag
versions: + Python 3.4
2014-05-26 10:40:50ezio.melottisetstage: commit review
2014-05-06 07:43:14Steven.Barkercreate