Repository navigation
Fix title formatting when fixture fails setup (fixes #873) - #939
Open
udayraj1238 wants to merge 1 commit into
Open
udayraj1238 wants to merge 1 commit into
udayraj1238 wants to merge 1 commit into
Conversation
…p fails (fixes allure-framework#873) Signed-off-by: udayraj1238 <rajuday6002@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Fixes #873
When a parametrized fixture fails or is skipped during test setup,
pytestretains the raw parameter initem.callspec.params(e.g. primitive1), butitem.funcargsis not populated with the fixture instance. When@allure.titleformats a field accessing fixture attributes (e.g.{fix.attribute}),SafeFormatter().format()inallure_name()attempted attribute access on the raw parameter and raisedAttributeError: 'int' object has no attribute 'attribute'.This escaped
allure_name()duringpytest_runtest_setup, raising an unhandled exception that broke test execution and shadowed the actual fixture error or skip.Changes
(AttributeError, IndexError, TypeError)during title string formatting inallure_name(), returning the title template string instead of aborting test setup.test_failed_parametrized_fixture_attribute_in_display_nameintests/allure_pytest/acceptance/display_name/display_name_test.pyverifying that skipped or failed parametrized fixtures with attribute access in@allure.titleretain the expected title without crashing test setup.Checklist