How can i get to show all the logs of pytest into Allure. and what are stdout and stderr used for ?
Please check the Highlighted Code which i am referring to
Allure Framework is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what have been tested in a neat web report form, but allows everyone participating in the development process to extract maximum of useful information from everyday execution of tests.
Allure is a reporting framework that represents brief reports in a clear form. This report template is available after you install ReadyAPI. It exports reports in the Allure results format. To transform them to an actual report, you need to use the Allure framework.
The stdout and stderr are used to display output produced by tests to those steams. To get them (and log) populated in Allure report your test or application executed by test have to produce output to corresponding streams.
import logging
import sys
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
def test_001():
logger.info('Logged INFO message')
logger.warning('Logged WARNING message')
logger.error('Logged ERROR message')
print('Message outputted to stdout')
print('Message outputted to stderr', file=sys.stderr)
assert 1 == 1
Output from test above:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With