Title: Attribute error in @allure.title when using @pytest.fixture(params=[...] · Issue #873 · allure-framework/allure-python · GitHub
Open Graph Title: Attribute error in @allure.title when using @pytest.fixture(params=[...] · Issue #873 · allure-framework/allure-python
X Title: Attribute error in @allure.title when using @pytest.fixture(params=[...] · Issue #873 · allure-framework/allure-python
Description: @allure.title decorator doesn't correctly formats a title string when using a parametrized fixture and having that fixture skip a test or raise an error: import pytest import allure class TestClass: @pytest.fixture(params=[1, 2]) # <-- c...
Open Graph Description: @allure.title decorator doesn't correctly formats a title string when using a parametrized fixture and having that fixture skip a test or raise an error: import pytest import allure class TestClass...
X Description: @allure.title decorator doesn't correctly formats a title string when using a parametrized fixture and having that fixture skip a test or raise an error: import pytest import allure class TestC...
Opengraph URL: https://github.com/allure-framework/allure-python/issues/873
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Attribute error in @allure.title when using @pytest.fixture(params=[...]","articleBody":"@allure.title decorator doesn't correctly formats a title string when using a parametrized fixture and having that fixture skip a test or raise an error:\n\n```\nimport pytest\nimport allure\n\n\nclass TestClass:\n @pytest.fixture(params=[1, 2]) # \u003c-- causes AttributeError: 'int' object has no attribute 'one'\n # @pytest.fixture()\n def params(self):\n # will cause AttributeError in allure.title\n # if this fixture is skipping tests\n pytest.skip('skip')\n \n # or raising an error\n raise ValueError('aa')\n\n class _Params:\n \"\"\"some params every test needs\"\"\"\n one = 1\n two = 2\n\n # but no error if it returns a value\n return _Params()\n\n @allure.title('should display \"1\" {params.one}')\n def test_func(self, params): # \u003c-- causes AttributeError: 'int' object has no attribute 'one'\n assert params.one == 1\n```\n```\nself = \u003callure_commons.utils.SafeFormatter object at 0x7f1851ab19d0\u003e, field_name = 'params.one', args = (), kwargs = {'param_id': '2', 'params': 2}\n\n def get_field(self, field_name, args, kwargs):\n first, rest = _string.formatter_field_name_split(field_name)\n \n obj = self.get_value(first, args, kwargs)\n \n # loop through the rest of the field_name, doing\n # getattr or getitem as needed\n for is_attr, i in rest:\n if is_attr:\n\u003e obj = getattr(obj, i)\n ^^^^^^^^^^^^^^^\nE AttributeError: 'int' object has no attribute 'one'\n\n/usr/lib64/python3.12/string.py:305: AttributeError\n=================================================================== short test summary info ====================================================================\nERROR p.py::TestClass::test_func[1] - AttributeError: 'int' object has no attribute 'one'\nERROR p.py::TestClass::test_func[2] - AttributeError: 'int' object has no attribute 'one'\n====================================================================== 2 errors in 0.14s =======================================================================\n```\n\nThis is shadowing the real error or skip in the fixture and is similar to #670\n\n```\nallure-pytest==2.15.0\npytest==8.4.1\n```","author":{"url":"https://github.com/tsvtt","@type":"Person","name":"tsvtt"},"datePublished":"2025-08-06T13:16:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/873/allure-python/issues/873"}
| 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:f7a738be-f9b1-83f8-8c4d-df57f4ef1c33 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C890:3B6C5C:4BF454:674DD3:696E755E |
| html-safe-nonce | 63a3884835136ceb4b72dddf0b8b6541470525b97f7601fda16da9183134bd98 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODkwOjNCNkM1Qzo0QkY0NTQ6Njc0REQzOjY5NkU3NTVFIiwidmlzaXRvcl9pZCI6IjU0Nzg2NDExMDc1MTc0NzAwNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c8d0c6f7e9fa050b8e1f87a6c5e0865c55ae02c9931012e93101be5afc8f1714 |
| hovercard-subject-tag | issue:3296680653 |
| 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/873/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f9d355b5a7dbe1d30385bcc4806829836098e260393648232c5faa93824f0d84/allure-framework/allure-python/issues/873 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f9d355b5a7dbe1d30385bcc4806829836098e260393648232c5faa93824f0d84/allure-framework/allure-python/issues/873 |
| og:image:alt | @allure.title decorator doesn't correctly formats a title string when using a parametrized fixture and having that fixture skip a test or raise an error: import pytest import allure class TestClass... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tsvtt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01185010a96388a2a8cd8bd7f5824fdf090522b219f9aecf8c7ff1857aeb489b |
| 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 | 673a80c1bce2a1e6a48b530ce2b72bf8fd253386 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width