Skip to content

[3.14] gh-137463: Update validate_abstract_methods in test_collections.py (GH-137464)#137503

Merged
encukou merged 2 commits intopython:3.14from
miss-islington:backport-5be8723-3.14
Oct 8, 2025
Merged

[3.14] gh-137463: Update validate_abstract_methods in test_collections.py (GH-137464)#137503
encukou merged 2 commits intopython:3.14from
miss-islington:backport-5be8723-3.14

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 7, 2025

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 5be8723)

Co-authored-by: Guilherme Leobas guilhermeleobas@gmail.com

…ons.py` (pythonGH-137464)

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 5be8723)

Co-authored-by: Guilherme Leobas <guilhermeleobas@gmail.com>
@encukou encukou merged commit 7ed5419 into python:3.14 Oct 8, 2025
44 checks passed
@miss-islington miss-islington deleted the backport-5be8723-3.14 branch January 2, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants