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

BUG - Breaking change with allure.title annotations in 2.8.24 #536

Closed
FerdinandNell opened this issue Dec 10, 2020 · 6 comments
Closed

BUG - Breaking change with allure.title annotations in 2.8.24 #536

FerdinandNell opened this issue Dec 10, 2020 · 6 comments

Comments

@FerdinandNell
Copy link

I'm submitting a ...

  • [ X ] bug report

What is the current behavior?

allure-pytest 2.8.24 is causing the following to happen during pytest execution:

.pyenv-usr-local-bin-python3/lib/python3.9/site-packages/allure_pytest/helper.py:19: in decorator
function.allure_display_name = test_title
AttributeError: 'NoneType' object has no attribute 'allure_display_name'

-- Have removed the @allure.title("erfde") annotations from the tests and tried again but its still doing the same thing.

Please tell us about your environment:

  • Allure version: 2.1.0
  • Test framework: pytest=6.0.1
  • Allure adaptor: allure-pytest 2.8.24
@sseliverstov
Copy link
Contributor

@FerdinandNell can you show test code (only decorators without test body) ?

@FerdinandNell
Copy link
Author

@sseliverstov
image

@rad96
Copy link
Contributor

rad96 commented Dec 10, 2020

Tried this code, working as intended 🤔

import allure
import unittest


class Test(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        pass

    def setUp(self):
        pass

    @allure.title('Titled test - test')
    def test_test(self):
        pass

@FerdinandNell
Copy link
Author

So this test class is being imported in another test class in order to re-use some of the automation logic, not sure if the import process is causing issues:

Import:
image

Execution:
image

@devawpshko
Copy link

devawpshko commented Dec 17, 2020

python 3.8.5
pytest 6.2.1
allure-pytest 2.8.24

test_trial.py:

import pytest
from testdata import fields

@pytest.mark.parametrize("my_data", fields)
def test_01(my_data):
    assert True

testdata.py:

import allure
import pytest

fields = [
    pytest.param(
        "value",
        id="001",
        marks=[allure.title("Some test")]
    )
]

@delatrie
Copy link
Contributor

Cannot reproduce.
If someone still struggles with this, please let me know and provide a complete code example if possible.

Regarding @devawpshko example, please, note, that starting from 2.8.23 @allure.title does not return a pytest mark anymore. This was done to make it possible to set a title of a fixture, something that is impossible to do with a pytest mark (see #210, #527 and pytest-dev/pytest#3960).

I leave this issue open for a couple of weeks just in case someone will provide feedback.

@delatrie delatrie closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants