Title: Implement Allure listeners · Issue #855 · allure-framework/allure-python · GitHub
Open Graph Title: Implement Allure listeners · Issue #855 · allure-framework/allure-python
X Title: Implement Allure listeners · Issue #855 · allure-framework/allure-python
Description: Context People often need to somehow post-process Allure results according to their needs. Examples would be: filtering data they don't want in the report (parameters/labels/fixtures) customizing the default names, existing parameters, e...
Open Graph Description: Context People often need to somehow post-process Allure results according to their needs. Examples would be: filtering data they don't want in the report (parameters/labels/fixtures) customizing t...
X Description: Context People often need to somehow post-process Allure results according to their needs. Examples would be: filtering data they don't want in the report (parameters/labels/fixtures) customizi...
Opengraph URL: https://github.com/allure-framework/allure-python/issues/855
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement Allure listeners","articleBody":"### Context\n\nPeople often need to somehow post-process Allure results according to their needs. Examples would be:\n\n - filtering data they don't want in the report (parameters/labels/fixtures)\n - customizing the default names, existing parameters, etc\n - sending the results somewhere on the fly\n\nMany such requirements are user-specific, and there is no point in implementing them here. Often, it's not even possible because many such requirements contradict each other.\n\nInstead, it would be reasonable to have an easy-to-use extension mechanism that users may utilize for their purposes.\n\n### Existing solution\n\nCurrently, users can register custom plugins in `allure_commons.plugin_manager`. For example:\n\n```python\nfrom allure_commons import hookimpl\nfrom allure_commons import plugin_manager\n\nclass MyListener:\n @hookimpl(tryfirst=True)\n def report_result(self, result):\n # post-process the result here\n ...\n\ndef pytest_configure(config):\n\n def cleanup():\n name = plugin_manager.get_name(listener)\n plugin_manager.unregister(name=name)\n\n listener = MyListener()\n plugin_manager.register(listener)\n config.add_cleanup(cleanup)\n```\n\nWhile covering many cases, the solution has some drawbacks:\n\n - Verbose API:\n - `tryfirst` is necessary to make sure the hook implementation is called after the default logger's one.\n - The cleanup needs to be added separately.\n - Limited hook spec:\n - No steps and fixtures post-processing (only at the test result level, which complicates the processing).\n - Limited support for attachments post-processing.\n - No hooks for pre-processing.\n\n### Implementation\n\nLifecycle listeners can be implemented with [pluggy](https://pluggy.readthedocs.io/en/stable/) as a plugin manager + hook specs + user-friendly API on top of this. We already use pluggy to implement the Allure API, so it's just a matter of defining one or more hook specs, calling them via the existing `allure_commons.plugin_manager` or a separate one.","author":{"url":"https://github.com/delatrie","@type":"Person","name":"delatrie"},"datePublished":"2025-04-22T17:03:35Z","url":"https://github.com/allure-framework/allure-python/issues/855"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3cfc3607-e6d3-d59a-831a-e1c0451a4722 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 831A:160FD0:27A27E2:3739F2F:6AFD4A43 |
| html-safe-nonce | ea800086d4878eab56b1e40b83433cfeb59f32923819e5c7b0f3f5f09ba2782d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzFBOjE2MEZEMDoyN0EyN0UyOjM3MzlGMkY6NkFGRDRBNDMiLCJ2aXNpdG9yX2lkIjoiNjYxMDIwMTA5ODM4MjU1OTgxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2df387818209ac40a66ce587e63514ef825c1de42babadf0fab3fa5c7c3733a3 |
| hovercard-subject-tag | issue:3011641380 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/allure-framework/allure-python/855/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1c5ba6c51ad28ba83d487cd3f92b68a682185f4acdc3ae5dc745b3e38fc5c3c5/allure-framework/allure-python/issues/855 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1c5ba6c51ad28ba83d487cd3f92b68a682185f4acdc3ae5dc745b3e38fc5c3c5/allure-framework/allure-python/issues/855 |
| og:image:alt | Context People often need to somehow post-process Allure results according to their needs. Examples would be: filtering data they don't want in the report (parameters/labels/fixtures) customizing t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | delatrie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/allure-framework/allure-python git https://github.com/allure-framework/allure-python.git |
| octolytics-dimension-user_id | 5879127 |
| octolytics-dimension-user_login | allure-framework |
| octolytics-dimension-repository_id | 79346720 |
| octolytics-dimension-repository_nwo | allure-framework/allure-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 79346720 |
| octolytics-dimension-repository_network_root_nwo | allure-framework/allure-python |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width