René's URL Explorer Experiment


Title: fix(pytest): stop reporting pytest's own finalizer as a phantom teardown by Mohanad49 · Pull Request #921 · allure-framework/allure-python · GitHub

Open Graph Title: fix(pytest): stop reporting pytest's own finalizer as a phantom teardown by Mohanad49 · Pull Request #921 · allure-framework/allure-python

X Title: fix(pytest): stop reporting pytest's own finalizer as a phantom teardown by Mohanad49 · Pull Request #921 · allure-framework/allure-python

Description: Description Closes #918. From pytest 9.1, FixtureDef.execute attaches an internal finalizer to every fixture. pytest_fixture_setup wrapped it along with the real ones, so every fixture produced an extra afterStage: fixture_with_finalizer::teardown status=passed <- real fixture_with_finalizer:: status=None <- pytest's own simple_fixture::1 status=passed <- real simple_fixture:: status=None <- pytest's own pytest never calls that finalizer through Allure's wrapper, so nothing ever closes the stage and it is written out with no status — which the report renders as unknown, once per fixture, on every run. Confirmed as FixtureDef.execute.., owned by _pytest.fixtures: [probe] simple_fixture name='' module='_pytest.fixtures' qualname=FixtureDef.execute.. name='?' module='functools' (the yield-fixture teardown) [probe] fixture_with_finalizer name='' module='_pytest.fixtures' qualname=FixtureDef.execute.. name='teardown' module='test_phantom' (the author's finalizer) The fix Skip finalizers owned by _pytest. The check is on the owning module, not on the name. Filtering would have been shorter and wrong: a lambda passed to request.addfinalizer by a test author is a real teardown and has to keep being reported. The functools.partial that implements yield-fixture teardown is likewise untouched, so simple_fixture::1 still appears. Testing tests/allure_pytest — 273 passed, 2 xfailed (271 before, plus the two added here). ruff clean. The two tests do different jobs, deliberately: Test Without the fix With the fix test_pytest_internal_finalizer_is_not_reported fails passes test_user_lambda_finalizer_is_still_reported passes passes The first is the regression test — I checked it fails on unpatched main, otherwise it would be asserting nothing. The second passes either way on purpose: it guards the fix against becoming too aggressive, and would start failing if someone later narrowed the filter to the name. I ran the existing suite on unpatched main too — 271 passed there as well, so nothing currently covers this, which is presumably how it shipped. Verified against pytest 9.1.1 / Python 3.11. The filter is a no-op on older pytest, which has no such finalizer.

Open Graph Description: Description Closes #918. From pytest 9.1, FixtureDef.execute attaches an internal finalizer to every fixture. pytest_fixture_setup wrapped it along with the real ones, so every fixture produced an ...

X Description: Description Closes #918. From pytest 9.1, FixtureDef.execute attaches an internal finalizer to every fixture. pytest_fixture_setup wrapped it along with the real ones, so every fixture produced an ...

Opengraph URL: https://github.com/allure-framework/allure-python/pull/921

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ddcb50c3-624d-6757-2862-67a99c9f54b4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBD5A:31EA7D:15CACD:1DA38E:6AFD4D54
html-safe-nonce973fef6011399a87e94d455cbc1464691b4e95f29c99ae6b4d37d507beaaa06c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDVBOjMxRUE3RDoxNUNBQ0Q6MURBMzhFOjZBRkQ0RDU0IiwidmlzaXRvcl9pZCI6IjQyNzUwOTI4NTIwMjg4MjA4MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac518d8f1fbf1e5bf1595aa94eadb9153f6497fea00a8a538a45ba3a89e48200e6
hovercard-subject-tagpull_request:4292054995
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/allure-framework/allure-python/pull/921/files
twitter:imagehttps://avatars.githubusercontent.com/u/134085492?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/134085492?s=400&v=4
og:image:altDescription Closes #918. From pytest 9.1, FixtureDef.execute attaches an internal finalizer to every fixture. pytest_fixture_setup wrapped it along with the real ones, so every fixture produced an ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/allure-framework/allure-python git https://github.com/allure-framework/allure-python.git
octolytics-dimension-user_id5879127
octolytics-dimension-user_loginallure-framework
octolytics-dimension-repository_id79346720
octolytics-dimension-repository_nwoallure-framework/allure-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id79346720
octolytics-dimension-repository_network_root_nwoallure-framework/allure-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/allure-framework/allure-python/pull/921/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fallure-framework%2Fallure-python%2Fpull%2F921%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fallure-framework%2Fallure-python%2Fpull%2F921%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=allure-framework%2Fallure-python
Reloadhttps://github.com/allure-framework/allure-python/pull/921/files
Reloadhttps://github.com/allure-framework/allure-python/pull/921/files
Reloadhttps://github.com/allure-framework/allure-python/pull/921/files
allure-frameworkhttps://github.com/allure-framework
allure-pythonhttps://github.com/allure-framework/allure-python
Codehttps://github.com/allure-framework/allure-python
Issues101 (101)https://github.com/allure-framework/allure-python/issues
Pull requests33 (33)https://github.com/allure-framework/allure-python/pulls
Actionshttps://github.com/allure-framework/allure-python/actions
Security and qualityhttps://github.com/allure-framework/allure-python/security
Insightshttps://github.com/allure-framework/allure-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fallure-framework%2Fallure-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fallure-framework%2Fallure-python%2Fissues%2Fnew%2Fchoose
Mohanad49https://github.com/Mohanad49
allure-framework:masterhttps://github.com/allure-framework/allure-python/tree/master
Mohanad49:fix/internal-finalizer-phantom-teardownhttps://github.com/Mohanad49/allure-python/tree/fix/internal-finalizer-phantom-teardown
Conversation 2 https://github.com/allure-framework/allure-python/pull/921
Commits 2 https://github.com/allure-framework/allure-python/pull/921/commits
Checks 19 https://github.com/allure-framework/allure-python/pull/921/checks
Files changed https://github.com/allure-framework/allure-python/pull/921/files
Please reload this pagehttps://github.com/allure-framework/allure-python/pull/921/files
fix(pytest): stop reporting pytest's own finalizer as a phantom teardown https://github.com/allure-framework/allure-python/pull/921/files#top
Show all changes 2 commits https://github.com/allure-framework/allure-python/pull/921/files
dd92a0b fix(pytest): stop reporting pytest's own finalizer as a teardown Mohanad49 Aug 16, 2026 https://github.com/allure-framework/allure-python/pull/921/commits/dd92a0b0a22038f69eb56d78742337c70dc8ff66
6ec48b7 Merge branch 'master' into fix/internal-finalizer-phantom-teardown Mohanad49 Oct 8, 2026 https://github.com/allure-framework/allure-python/pull/921/commits/6ec48b726146d9f676d1bbe4d9d32873ae1474bd
Clear filters https://github.com/allure-framework/allure-python/pull/921/files
Please reload this pagehttps://github.com/allure-framework/allure-python/pull/921/files
Please reload this pagehttps://github.com/allure-framework/allure-python/pull/921/files
listener.py https://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
utils.py https://github.com/allure-framework/allure-python/pull/921/files#diff-6e193e999f1c57979aef3f32198abb087385243d129deebef6dca1c1a79b56a3
internal_finalizer_test.py https://github.com/allure-framework/allure-python/pull/921/files#diff-4112773a4d64e3b799ee45aeb7467502082be80feb8859b8a5fc17e1eac408a4
allure-pytest/src/listener.pyhttps://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
View file https://github.com/allure-framework/allure-python/blob/6ec48b726146d9f676d1bbe4d9d32873ae1474bd/allure-pytest/src/listener.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/allure-framework/allure-python/pull/921/{{ revealButtonHref }}
https://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
https://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
https://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
https://github.com/allure-framework/allure-python/pull/921/files#diff-fefb374ddcddaa062601d8d7f5b15f0a5d80552dea44452f34eec87a3a9bada7
allure-pytest/src/utils.pyhttps://github.com/allure-framework/allure-python/pull/921/files#diff-6e193e999f1c57979aef3f32198abb087385243d129deebef6dca1c1a79b56a3
View file https://github.com/allure-framework/allure-python/blob/6ec48b726146d9f676d1bbe4d9d32873ae1474bd/allure-pytest/src/utils.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/allure-framework/allure-python/pull/921/{{ revealButtonHref }}
https://github.com/allure-framework/allure-python/pull/921/files#diff-6e193e999f1c57979aef3f32198abb087385243d129deebef6dca1c1a79b56a3
tests/allure_pytest/acceptance/fixture/internal_finalizer_test.pyhttps://github.com/allure-framework/allure-python/pull/921/files#diff-4112773a4d64e3b799ee45aeb7467502082be80feb8859b8a5fc17e1eac408a4
View file https://github.com/allure-framework/allure-python/blob/6ec48b726146d9f676d1bbe4d9d32873ae1474bd/tests/allure_pytest/acceptance/fixture/internal_finalizer_test.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/allure-framework/allure-python/pull/921/{{ revealButtonHref }}
Please reload this pagehttps://github.com/allure-framework/allure-python/pull/921/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.