Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve context manager #826

Open
1 task done
danielhoherd opened this issue Sep 10, 2024 · 0 comments
Open
1 task done

Improve context manager #826

danielhoherd opened this issue Sep 10, 2024 · 0 comments

Comments

@danielhoherd
Copy link

I'm submitting a ...

  • feature request

What is the current behavior?

Context manager for allure.step() does not allow assigning a variable name, which would be useful.

What is the expected behavior?

I'd like it if this worked:

with allure.step('foo') as s:
    print(s.title)

I expected that to work because this does work:

s = allure.step('foo')
print(s.title)

What is the motivation / use case for changing the behavior?

Having this named context manager would keep very simple code DRY.

Please tell us about your environment:

  • Allure version: 🤷‍♂️ I'm just doing the code review, not sure how to determine this.
  • Test framework: pytest@^8.2.2
  • Allure adaptor: allure-pytest@^2.13.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant