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: test_site.py has a couple of stray self.assertTrue calls that test for equality
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: dmalcolm, ezio.melotti
Priority: normal Keywords: easy, needs review, patch

Created on 2010-08-16 19:44 by dmalcolm, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix-stray-assertTrue-calls.patch dmalcolm, 2010-08-16 21:56 Patch against the 2.7 branch
Messages (5)
msg114069 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-08-16 19:44
test_site.py has a couple of assertions of the form

  self.assertTrue(len(foo), some number)

which appear to be incorrect, and should read:

  self.assertEqual(len(foo), some number)

or assertEquals (that file uses both methods).

r76047 fixed some of these, but a couple remain (introduced in r74526) in both 2.7 branch and py3k.  Patch attached (for 2.7 branch)
msg114074 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-08-16 20:34
It looks like you forgot to attach the patch :)
msg114075 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-08-16 20:39
(BTW assertEquals is deprecated, see #9424)
msg114079 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-08-16 21:56
Hopefully actually attaching the patch this time

I've used assertEqual in the lines I've touched.  I haven't touched the other lines, in order to isolate the semantic fix from the stylistic one.
msg114106 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-08-17 08:47
Fixed in r84134 (py3k) and r84135 (2.7). Thanks for the report and the patch!
History
Date User Action Args
2022-04-11 14:57:05adminsetgithub: 53832
2010-08-17 08:47:07ezio.melottisetstatus: open -> closed
messages: + msg114106

assignee: ezio.melotti
resolution: fixed
stage: patch review -> resolved
2010-08-16 21:56:29dmalcolmsetfiles: + fix-stray-assertTrue-calls.patch

messages: + msg114079
2010-08-16 20:39:28ezio.melottisetmessages: + msg114075
2010-08-16 20:34:16ezio.melottisetnosy: + ezio.melotti

messages: + msg114074
versions: - Python 3.3
2010-08-16 19:44:25dmalcolmcreate