pytest-catchlog pluggin cannot be enabled even by disabling the logging builtin plugin #3126
Labels
plugin: logging
related to the logging builtin plugin
topic: config
related to config handling, argument parsing and config file
type: enhancement
new feature or API change, should be merged into features branch
Summary
DOCs suggest that
pytest-catchlog
plugin should be still supported, by disabling the conflicting builtin logging plugin in the pytest.ini. (or with -p no:logging command line argument).However, I can see that the plugin is never registered, thus it's unusable. See code bellow:
pytest/_pytest/config.py
Lines 245 to 250 in 150537d
Removing the
return
in the code will not solve the problem but will give error message,argparse.ArgumentError: argument --no-print-logs: conflicting option string(s): --no-print-logs
So, we should agree on one of the following:
Why I still need catchlog?
What I actually need, is seeing is seeing live-logs in the console output, which is done by -s option. but in the same time, capturing it, so that I can get the same logs in the xunit.xml file, which I am creating with the --junit-xml option. (junit-xml takes all captured output and puts it in the relevant sections in the xml file).
Maybe not worth to be mentioned, but just for completeness, what we actually do, is use -s option, and then capture logs with catchlog plugin which we forked to support the following: rename the report section from system-log to system-out/system-err which comply with the Junit xml schema and are parsed properly by Jenkins Junit plugin.
From first glance looks like #3013 might in the end solve my case and drop need for catchlog in general, but till then I 'll have to use my customized fork of the catchlog, which in now incompatible with pytest > 3.2.5.
The text was updated successfully, but these errors were encountered: