allure-python icon indicating copy to clipboard operation
allure-python copied to clipboard

AttributeError: 'NoneType' object has no attribute 'status'

Open 229max opened this issue 4 years ago • 0 comments

I'm submitting a ...

  • [x] 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?

    @pytest.hookimpl
    def pytest_bdd_step_error(self, request, feature, scenario, step, step_func, step_func_args, exception):
        uuid = get_uuid(str(id(step)))
        with self.lifecycle.update_step(uuid=uuid) as step_result:
>           step_result.status = Status.FAILED
E           AttributeError: 'NoneType' object has no attribute 'status'

.venv/lib/python3.9/site-packages/allure_pytest_bdd/pytest_bdd_listener.py:79: AttributeError

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

# test.feature
Feature: FailedInFixture

  @TC-11
  Scenario: Test failed in fixture
    Given pre data

# step.py
@fixture(name="pre_test_data")
def pre_test_data():
    logger.info("pre data")
    assert 0, "failed in pre fixture"

@given(parsers.cfparse("pre data"))
def step_function(pre_test_data):
    logger.info("in step")

Got NonType error with scenario failed without step info.

What is the expected behavior?

scenario failed and the step failed.

Please tell us about your environment:

Other information

229max avatar Jul 23 '21 07:07 229max