You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_example(self, caplog):
a=1b=2c= [2, 4, 6]
check.greater(a, b)
check.less_equal(b, a)
check.is_in(a, c, "Is 1 in the list")
check.is_not_in(b, c, "make sure 2 isn't in list")
i see all failed in consol but not in logging file : Log/test_execution.log.
how can i collect all failure from console and save it into file ?
The text was updated successfully, but these errors were encountered:
pytest-check doesn't write to output through the logging module.
Results are reported through standard pytest longrepr result.
And pytest, as far as I know, does not reported to the logging module.
There is a plugin, pytest-reportlog, that creates a json file for results, and includes the longrepr, which might be what you're looking for.
However, a simple way to capture the output is just to pipe the results to a file.
Example in bash: pytest test_example.py > output.txt
or: pytest test_example.py | tee output.txt
Hi
i have pytest logging configuration in toml file
when i execute :
i see all failed in consol but not in logging file : Log/test_execution.log.
how can i collect all failure from console and save it into file ?
The text was updated successfully, but these errors were encountered: