classification
Title: unittest assert helper methods have incorrect signature in docs
Type: Stage:
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ezio.melotti, michael.foord, rbcollins, xtreak, אורי
Priority: normal Keywords:

Created on 2019-01-07 04:17 by אורי, last changed 2021-04-25 16:15 by iritkatriel.

Messages (3)
msg333137 - (view) Author: אורי (אורי) Date: 2019-01-07 04:17
I think some functions of `class TestCase` are not documented correctly in the docs. For example in https://docs.python.org/3.5/library/unittest.html and also https://docs.python.org/3.6/library/unittest.html and https://docs.python.org/3.7/library/unittest.html.

Some of the functions which are not documented correctly:

assertListEqual
assertSetEqual
assertDictEqual
assertIsNone

And many other functions.

You can see some more details on https://github.com/python/typeshed/issues/2716.
msg333139 - (view) Author: אורי (אורי) Date: 2019-01-07 04:27
1. I think the main problem is where it's documented "first, second" while the real argument names are different.

2. I think maybe https://docs.python.org/2.7/library/unittest.html is also affected in functions such as:

assertGreater(first, second, msg=None)
assertGreaterEqual(first, second, msg=None)
assertLess(first, second, msg=None)
assertLessEqual(first, second, msg=None)
msg333163 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-07 15:15
Thanks for the report. Looking at git history it seems there were some changes done in issue10573 to use (actual, expected) for consistency and later changed to use (first, second) in the same issue at msg126911. Discussion for the issue : https://mail.python.org/pipermail/python-dev/2010-December/106875.html

I think this is a bug as seen from typeshed https://github.com/python/typeshed/pull/2724/. But I will defer it to the maintainer to take a call on the same given there was a discussion in the past.

Removing versions that are on security fix only mode. I am changing the subject. Feel free to reword/revert.
History
Date User Action Args
2021-04-25 16:15:40iritkatrielsetversions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.7, Python 3.8
2019-01-08 19:03:18brett.cannonsetnosy: + rbcollins, michael.foord
2019-01-07 15:15:59xtreaksetnosy: + ezio.melotti, xtreak
title: class TestCase: docs are not correct -> unittest assert helper methods have incorrect signature in docs
messages: + msg333163

versions: - Python 3.4, Python 3.5, Python 3.6
2019-01-07 04:30:16אוריsetversions: + Python 3.4, Python 3.8
2019-01-07 04:27:43אוריsetmessages: + msg333139
versions: + Python 2.7
2019-01-07 04:17:47אוריcreate