GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support allure.title decorator for fixtures · Issue #210 · allure-framework/allure-python

Support allure.title decorator for fixtures #210

New issue
Copy link
New issue
Copy link
Closed
#527
Closed
Support allure.title decorator for fixtures#210
#527
Copy link
Labels
theme:coretype:enhancement

Description

@tikon93
tikon93
opened on Mar 16, 2018
Issue body actions

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

All of fixtures are shown at report as they named in code.

What is the expected behavior?

I suggest to support allure.title decorator for fixtures as it made for tests.
Code example:

    @allure.title('custom title')
    @pytest.fixture(autouse=True)
    def function_fixture(self,request,pytestconfig):

Please note that it should have effect both for setup and teardown steps. Also, there are old-style fixtures and yield fixtures - both of them should have an ability to use allure.title.

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

It will add possibility to make abstract of fixture representation in report from its realization in code. Reports will be easier to read for people not relating to code (managers etc).

Please tell us about your environment:

  • Allure version: 2.6.0
  • Test framework: [email protected]
  • Allure adaptor: [email protected]

Activity

  1. sseliverstov
    added
    theme:core
    type:enhancement
    on Jul 6, 2018
  2. symonk commented on Feb 27, 2019

    @symonk
    symonk
    on Feb 27, 2019
    More actions

    I will look into this one, I have a need for it personally also

  3. ShurikMen commented on Sep 9, 2020

    @ShurikMen
    ShurikMen
    on Sep 9, 2020
    Contributor
    More actions

    Maybe this is what is required?

    import pytest
    import allure
    
    
    @pytest.fixture(name='Какая-то фикстура')
    def some_fixture():
        with allure.step('Подшаг в фикстуре, при настройке'):
            pass
        yield "Эта фиктура возвращает волшебное слово"
        with allure.step('Подшаг в фикстуре, при завершении'):
            pass
    
    
    class TestClassOne:
        @pytest.mark.usefixtures('Какая-то фикстура')
        def test_1(self, request):
            with allure.step('Шаг в функции'):
                allure.attach(request.getfixturevalue('Какая-то фикстура'), 'Получили из фикстуры:', allure.attachment_type.TEXT)
    

    image

    Reacted by Simon K and Peter
  4. rad96 commented on Nov 30, 2020

    @rad96
    rad96
    on Nov 30, 2020
    Contributor
    More actions

    Maybe this is what is required?

    import pytest
    import allure
    
    
    @pytest.fixture(name='Какая-то фикстура')
    def some_fixture():
        with allure.step('Подшаг в фикстуре, при настройке'):
            pass
        yield "Эта фиктура возвращает волшебное слово"
        with allure.step('Подшаг в фикстуре, при завершении'):
            pass
    
    
    class TestClassOne:
        @pytest.mark.usefixtures('Какая-то фикстура')
        def test_1(self, request):
            with allure.step('Шаг в функции'):
                allure.attach(request.getfixturevalue('Какая-то фикстура'), 'Получили из фикстуры:', allure.attachment_type.TEXT)
    

    image

    That's looks like a complicated overhead
    I made a little hack for parsing allure tag directly from source, it works, but it don't support any parametrization

  5. sseliverstov
    closed this as completedin #527on Dec 6, 2020
  6. sseliverstov
    added a commit that references this issue on Dec 6, 2020

    added @allure.title annotation support for fixtures (fixes #210 via #527

    This issue will close once commit ed38912 is merged into the 'master' branch.
    ed38912
  7. beckerGil
    added 2 commits that reference this issue on Apr 10, 2023

    added @allure.title annotation support for fixtures (fixes allure-fra…

    This issue will close once commit c4d4034 is merged into the 'master' branch.
    c4d4034

    added @allure.title annotation support for fixtures (fixes allure-fra…

    This issue will close once commit de6c243 is merged into the 'master' branch.
    de6c243
  8. IvanBuruyane
    added a commit that references this issue on Mar 19, 2024

    added @allure.title annotation support for fixtures (fixes allure-fra…

    This issue will close once commit 330afa1 is merged into the 'master' branch.
    330afa1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme:coretype:enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.