| route-pattern | /_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format) |
| route-controller | voltron_pull_requests_fragments |
| route-action | pull_request_layout |
| fetch-nonce | v2:0bffa566-e5c6-7c87-4ef2-08227d28e664 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9624:1C436E:137F907:1A29A5B:696E9F57 |
| html-safe-nonce | 9ffa27097a369e49e7b15b5c4c33f19beaf27069dc3512e740deaf6387534cbe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjI0OjFDNDM2RToxMzdGOTA3OjFBMjlBNUI6Njk2RTlGNTciLCJ2aXNpdG9yX2lkIjoiNjg4MzQ5NTI2OTIwOTYxODc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cd904a62672216f151e7d4551ff02761316303ed247917117dc397710f0994b7 |
| hovercard-subject-tag | pull_request:3184315718 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///voltron/pull_requests_fragments/pull_request_layout |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/143970/pull_request_layout |
| twitter:image | https://opengraph.githubassets.com/be261b20ab00172cdda8f3bad2172c50f4deda18ec8607d0f1939fb7d03b8e9d/python/cpython/pull/143970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be261b20ab00172cdda8f3bad2172c50f4deda18ec8607d0f1939fb7d03b8e9d/python/cpython/pull/143970 |
| og:image:alt | Closes #89900
Description
The Problem
At the moment, assertLogs removes the handlers attached to the logger. In general this is good, because it reduces message spamming in the test logs. However,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Yuheng3107 |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdad15fd2ad43212aa8b8be5f2c2725550f8374ceeeb154a999ad9145b43f3f7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 27b23bc056eb973d350fc95afc848757edb9e7a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#start-of-content |
|
| https://patch-diff.githubusercontent.com/ |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F143970 |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F143970 |
|
Sign up
| https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython |
| Reload | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Reload | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Reload | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
python
| https://patch-diff.githubusercontent.com/python |
| cpython | https://patch-diff.githubusercontent.com/python/cpython |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
Notifications
| https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fcpython |
|
Fork
33.9k
| https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fcpython |
|
Star
71.1k
| https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fcpython |
|
Code
| https://patch-diff.githubusercontent.com/python/cpython |
|
Issues
5k+
| https://patch-diff.githubusercontent.com/python/cpython/issues |
|
Pull requests
2.1k
| https://patch-diff.githubusercontent.com/python/cpython/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/python/cpython/actions |
|
Projects
31
| https://patch-diff.githubusercontent.com/python/cpython/projects |
|
Security
Uh oh!
There was an error while loading. Please reload this page.
| https://patch-diff.githubusercontent.com/python/cpython/security |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
Insights
| https://patch-diff.githubusercontent.com/python/cpython/pulse |
|
Code
| https://patch-diff.githubusercontent.com/python/cpython |
|
Issues
| https://patch-diff.githubusercontent.com/python/cpython/issues |
|
Pull requests
| https://patch-diff.githubusercontent.com/python/cpython/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/python/cpython/actions |
|
Projects
| https://patch-diff.githubusercontent.com/python/cpython/projects |
|
Security
| https://patch-diff.githubusercontent.com/python/cpython/security |
|
Insights
| https://patch-diff.githubusercontent.com/python/cpython/pulse |
| Sign up for GitHub
| https://patch-diff.githubusercontent.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| Jump to bottom | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#issue-comment-box |
| Yuheng3107 | https://patch-diff.githubusercontent.com/Yuheng3107 |
| python:main | https://patch-diff.githubusercontent.com/python/cpython/tree/main |
| Yuheng3107:assertlogs-optionally-not-disable-existing-handlers | https://patch-diff.githubusercontent.com/Yuheng3107/cpython/tree/assertlogs-optionally-not-disable-existing-handlers |
|
gh-89900: Add option to preserve existing handlers for assertLogs
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970#top |
| Yuheng3107 | https://patch-diff.githubusercontent.com/Yuheng3107 |
| python:main | https://patch-diff.githubusercontent.com/python/cpython/tree/main |
| Yuheng3107:assertlogs-optionally-not-disable-existing-handlers | https://patch-diff.githubusercontent.com/Yuheng3107/cpython/tree/assertlogs-optionally-not-disable-existing-handlers |
|
Conversation
8
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
Commits
3
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits |
|
Checks
47
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970/checks |
|
Files changed
5
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files |
| https://github.co/hiddenchars |
| https://patch-diff.githubusercontent.com/python/cpython/pull/{{ revealButtonHref }} |
|
| https://patch-diff.githubusercontent.com/Yuheng3107 |
| Yuheng3107 | https://patch-diff.githubusercontent.com/Yuheng3107 |
| Jan 17, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#issue-3825522082 |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| #89900 | https://github.com/python/cpython/issues/89900 |
| assertLogs to optionally not disable existing handlers #89900 | https://github.com/python/cpython/issues/89900 |
| https://cpython-previews--143970.org.readthedocs.build/ | https://cpython-previews--143970.org.readthedocs.build/ |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
| https://patch-diff.githubusercontent.com/Yuheng3107 |
| pythongh-89900 | https://github.com/python/cpython/issues/89900 |
| : Add option to not disable existing handlers for asser… | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/8d071b998983bccde9e0363ffe833d1cae96cf09 |
| 8d071b9 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/8d071b998983bccde9e0363ffe833d1cae96cf09 |
| https://patch-diff.githubusercontent.com/apps/bedevere-app |
| bedevere-app | https://patch-diff.githubusercontent.com/apps/bedevere-app |
|
Jan 17, 2026
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970#ref-issue-1199068834 |
|
assertLogs to optionally not disable existing handlers
#89900
| https://patch-diff.githubusercontent.com/python/cpython/issues/89900 |
| https://patch-diff.githubusercontent.com/apps/bedevere-app |
| bedevere-app | https://patch-diff.githubusercontent.com/apps/bedevere-app |
|
awaiting review
| https://patch-diff.githubusercontent.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22 |
| Jan 17, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#event-22115748176 |
| Yuheng3107 | https://patch-diff.githubusercontent.com/Yuheng3107 |
| January 17, 2026 08:50 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#commits-pushed-afa8515 |
|
| https://patch-diff.githubusercontent.com/Yuheng3107 |
| Merge branch 'main' into assertlogs-optionally-not-disable-existing-h… | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/afa8515eaefdf7ed8c2c4ea566352ba25206fdd6 |
| afa8515 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/afa8515eaefdf7ed8c2c4ea566352ba25206fdd6 |
|
| https://patch-diff.githubusercontent.com/apps/blurb-it |
| 📜🤖 Added by blurb_it. | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/bf37637a83de62aee1e061873104bfd4c42aedce |
| bf37637 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/commits/bf37637a83de62aee1e061873104bfd4c42aedce |
| https://patch-diff.githubusercontent.com/Yuheng3107 |
| Yuheng3107 | https://patch-diff.githubusercontent.com/Yuheng3107 |
| Jan 17, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#issuecomment-3764117438 |
| @vsajip | https://github.com/vsajip |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| https://patch-diff.githubusercontent.com/picnixz |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
|
Jan 18, 2026
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970#pullrequestreview-3675219533 |
|
View reviewed changes
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970#pullrequestreview-3675219533 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Lib/unittest/_log.py | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce#diff-3019f6de1ec052fe4d8344bad8b7a82c19fd806a585eb71758ed213e21ed066b |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#discussion_r2702101512 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Misc/NEWS.d/next/Library/2026-01-17-16-57-44.gh-issue-89900.vFsyFn.rst | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce#diff-c840771265ae6c4d256befebc2666822fc4b8e87b8e0663ad4daa6de13d72b3d |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#discussion_r2702101704 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Doc/library/unittest.rst | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce#diff-14c3c1d897d1e85767303f24626acaa6d1ea1162219c72caa240ef9f533ebe99 |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#discussion_r2702101964 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Doc/library/unittest.rst | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce#diff-14c3c1d897d1e85767303f24626acaa6d1ea1162219c72caa240ef9f533ebe99 |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#discussion_r2702102418 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Doc/library/unittest.rst | https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce#diff-14c3c1d897d1e85767303f24626acaa6d1ea1162219c72caa240ef9f533ebe99 |
| picnixz | https://patch-diff.githubusercontent.com/picnixz |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#discussion_r2702102760 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| https://patch-diff.githubusercontent.com/apps/bedevere-app |
| bedevere-app | https://patch-diff.githubusercontent.com/apps/bedevere-app |
|
awaiting changes
| https://patch-diff.githubusercontent.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20changes%22 |
|
awaiting review
| https://patch-diff.githubusercontent.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22 |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#event-22119840343 |
| https://patch-diff.githubusercontent.com/apps/bedevere-app |
| bedevere-app | https://patch-diff.githubusercontent.com/apps/bedevere-app |
| Jan 18, 2026 | https://patch-diff.githubusercontent.com/python/cpython/pull/143970#issuecomment-3764921879 |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
| Sign up for free | https://patch-diff.githubusercontent.com/join?source=comment-repo |
| Sign in to comment | https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F143970 |
|
| https://patch-diff.githubusercontent.com/picnixz |
|
picnixz
| https://patch-diff.githubusercontent.com/picnixz |
|
| https://patch-diff.githubusercontent.com/python/cpython/pull/143970/files/bf37637a83de62aee1e061873104bfd4c42aedce |
|
awaiting changes
| https://patch-diff.githubusercontent.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20changes%22 |
|
assertLogs to optionally not disable existing handlers
| https://github.com/python/cpython/issues/89900 |
| Please reload this page | https://patch-diff.githubusercontent.com/python/cpython/pull/143970 |
|
| https://patch-diff.githubusercontent.com/Yuheng3107 |
|
| https://patch-diff.githubusercontent.com/picnixz |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |