allure-python
allure-python copied to clipboard
BUG - Breaking change with allure.title annotations in 2.8.24
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
@FerdinandNell can you show test code (only decorators without test body) ?
@sseliverstov
Tried this code, working as intended :thinking:
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
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:
Execution:
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")]
)
]
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.