[New-bugs-announce] [issue21445] Some asserts in test_filecmp have the wrong messages

Steven Barker report at bugs.python.org
Tue May 6 09:43:14 CEST 2014

New submission from Steven Barker:

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.

components: Tests
files: filecmp_test_messages.diff
keywords: patch
messages: 217970
nosy: Steven.Barker
priority: normal
severity: normal
status: open
title: Some asserts in test_filecmp have the wrong messages
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file35160/filecmp_test_messages.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list