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

Running step decorated function outside tests causes Exception #232

Closed
1 of 3 tasks
Sup3rGeo opened this issue May 24, 2018 · 0 comments
Closed
1 of 3 tasks

Running step decorated function outside tests causes Exception #232

Sup3rGeo opened this issue May 24, 2018 · 0 comments

Comments

@Sup3rGeo
Copy link
Contributor

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?

Tests break when Running step decorated function outside test or fixture

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

Running this simple test shows the error:

import allure

with allure.step("step outside"):
    pass

def test1():
    assert 1 == 1
________________________ ERROR collecting test_one.py _________________________
test_one.py:7: in <module>
    with allure.step("step outside"):
d:\work\allure-python\allure-python-commons\allure_commons\_allure.py:131: in __enter__
    plugin_manager.hook.start_step(uuid=self.uuid, title=self.title, params=params)
c:\python36\lib\site-packages\pluggy\__init__.py:617: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
c:\python36\lib\site-packages\pluggy\__init__.py:222: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
c:\python36\lib\site-packages\pluggy\__init__.py:216: in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
d:\work\allure-python\allure-pytest\allure_pytest\listener.py:38: in start_step
    self.allure_logger.start_step(None, uuid, step)
d:\work\allure-python\allure-python-commons\allure_commons\reporter.py:77: in start_step
    self._items[parent_uuid].steps.append(step)
E   KeyError: None
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!

What is the expected behavior?

Simply ignore the allure step.

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

Sometimes we can decorate a function as step and this function is used outside a test function or fixture. This should not break the tests.

Please tell us about your environment:

  • Allure version: 2.6.0
  • Test framework: pytest@3.6
  • Allure adaptor: allure-pytest@2.3.2b1

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant