]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-137463: Update `validate_abstract_methods` in `test_collections.py` (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 8 Oct 2025 12:30:54 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Oct 2025 12:30:54 +0000 (14:30 +0200)
commit7ed541960493b1b5fce687c8c97d9a41e1095cd9
tree734a6954f6f935ecc311240573b50f88e9ab316c
parent333cab0da7e148c713a862330fabc269a145536a
[3.14] gh-137463: Update `validate_abstract_methods` in `test_collections.py` (GH-137464) (GH-137503)

Update `validate_abstract_methods` in `test_collections.py`

The test for missing abstract methods in `validate_abstract_methods` incorrectly attempted to instantiate the generated class `C` with an argument (`C(name)`), which always raises a `TypeError: C() takes no arguments`. Although the test originally passes, it passes for the wrong reason.

This change makes the test correctly validate the enforcement of abstract methods in ABCs.
(cherry picked from commit 5be872350d562e6c9987b09ff4b7bda80a2f9cd0)

Co-authored-by: Guilherme Leobas <guilhermeleobas@gmail.com>
Lib/test/test_collections.py