allure-pytest does not work with pytest-check
See original GitHub issueWhen using pytest-check to have delayed assertions in tests, allure marks all the tests as passed even when the delayed checks are false. After a little investigation it looks to be because of this check_func dec:
def check_func(func):
@functools.wraps(func)
def wrapper(*args, **kwds):
__tracebackhide__ = True
try:
func(*args, **kwds)
except AssertionError as e:
if _stop_on_fail:
raise e
log_failure(e)
return False
return wrapper
to recreate:
pip install pytest-check
import pytest_check as check
@allure.title('This test will pass on allure report')
def test_something(self):
check.equal(1, 2)
allure serve
# voila, report is green 😦
I guess because it is catching the AssertionError and logging it elsewhere. The actual pytest test is a failure, however allure reports a pass. No time to look into this right now, but any advice on where to start with it will be appreciated
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Generating allure report using pytest - python - Stack Overflow
I've encounter some problems while installing package pytest-allure-adaptor . It depends on lxml and the last one is automatically installed ...
Read more >Allure integration with pytest - Qxf2 BLOG
Integrate your python tests with Allure report to extract useful information from your test executions and make decisions.
Read more >Generating Allure reports in the Pytest framework - Medium
Generating Allure reports in the Pytest framework. This blog is a step-by-step guide to understand & implement allure test reports in a pytest...
Read more >Allure Framework
Allure Framework is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what have ...
Read more >allure-framework/allure-core - Gitter
in documentation is not specified, can you help with a starting point? @YuriIvanov ... @sseliverstov "install pytest-allure-plugin" this not work.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@skhomuti / @okken sorry been busy with other commitments, happy to spin up a venv and check, 1 second.
Edit: Can confirm it seems patched
dependencies:
allure commandline ->
2.14.0
Report is red as expected.
I have also removed my previous comment recommending another library as this did not originally work, as I don’t think it was very fair in hindsight (I apologise for that), thanks for your work on
pytest-check
. Would recommend exposingcheck
w/o an explicitname=
flag to help IDEs recommend it a little better, didn’t look overly at the code but:would make auto complete a lot happier
Thank you @skhomuti !