Skip to content

Improve context manager #826

Open
@danielhoherd

Description

@danielhoherd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions