-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Description
Bug report
Bug description:
There's almost no documentation for the file Lib/tests/list_tests.py
. But I infer from context that it's a suite of tests for list-like objects--not just list
, but types.UserList
and so on. (I assumed collections.deque
would take advantage of this... but it doesn't, huh.)
To use, you define a subclass of list_tests.CommonTest
that defines a type2test
method which converts an iterable into an object of your type, and run the tests in that object. Then, all the tests in that class use that callable to create the objects they test against.
Or... nearly all. There are (at least) three methods that don't call self.type2test
; they only test against list objects. The three methods I found.
CommonTest.test_getitem_error
CommonTest.test_setitem_error
CommonTest.test_constructor_exception_handling
I skimmed over the whole file and only saw those three. Of course I could have easily missed more.
I think someone should update those three tests so they test objects created using self.type2test
, and make a more thorough pass over the file making sure there aren't any other missing type2test
casts.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-138584: Fix missing type2test in Lib/tests/list_tests.py #138586
- gh-138584: Fix missing type2test in Lib/tests/list_tests.py #138590
- [3.13] gh-138584: Increase test coverage for
collections.UserList
(GH-138590) #138611 - [3.14] gh-138584: Increase test coverage for
collections.UserList
(GH-138590) #138612