Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve context manager #826

Copy link
Copy link
Open
Copy link
@danielhoherd

Description

@danielhoherd
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.