allure-framework / allure-python

Allure integrations for Python test frameworks
https://allurereport.org/
Apache License 2.0
722 stars 236 forks source link

i have facing issues AttributeError: module 'allure' has no attribute 'severity_level' #780

Open Diwa-max opened 10 months ago

Diwa-max commented 10 months ago

this source code import allure import pytest

@allure.severity_level(allure.severity_level.CRITICAL) @allure.feature("My Feature") @allure.story("My Story") def test_example(): with allure.step("Step 1: Performing an action"):

Your test code goes here

    assert 1 == 1

with allure.step("Step 2: Verifying the result"):
    # Additional steps or assertions
    assert "hello".upper() == "HELLO"

@allure.severity(allure.severity_level.NORMAL) @allure.feature("My Feature") @allure.story("My Story") def test_another_example(): with allure.step("Step 1: Another action"):

Another test code

    assert 2 + 2 == 4

with allure.step("Step 2: Verifying another result"):
    # Additional steps or assertions
    assert "world".capitalize() == "World"

AttributeError: module 'allure' has no attribute 'severity_level'

storenth commented 9 months ago

u have syntax err near 5th line of code: @allure.severity_level --> @allure.severity(allure.severity_level.CRITICAL)