Skip to content

improve test_copy_reduce and test_deepcopy_reduce coverage#154182

Open
dslavicek wants to merge 1 commit into
python:mainfrom
dslavicek:improve-copy-and-deepcopy-reduce-test-coverage2
Open

improve test_copy_reduce and test_deepcopy_reduce coverage#154182
dslavicek wants to merge 1 commit into
python:mainfrom
dslavicek:improve-copy-and-deepcopy-reduce-test-coverage2

Conversation

@dslavicek

Copy link
Copy Markdown
Contributor

Line 94 in copy() method and line 150 in deepcopy() method were not covered by tests. This happened because the reductor = getattr(x, "__reduce_ex__", None) at lines 88 and 144 took __reduce_ex__ from the object class which preventing reaching the else block where __reduce__ is checked.

This PR adds coverage for those two lines and by this increases branch coverage of the copy module to 100%.

printscreen of coverage check on main:
image

@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels Jul 19, 2026
@tomasr8 tomasr8 added the sprint label Jul 19, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review sprint tests Tests in the Lib/test dir

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants