[TIP] py.test skip messages not showing up
holger at merlinux.eu
Wed Dec 19 12:45:56 PST 2012
On Wed, Dec 19, 2012 at 11:52 -0500, Pella,Chris wrote:
> We have some tests that are being skipped if some preconditions are missed...
> if source_type == 'unsupported':
> pytest.skip("Unsupported configuration.")
> We are hoping to be able to see that "Unsupported configuration" string in the stdout so we can see why a test was skipped. How do we get py.test to send that string to stdout? Also, as a general suggestion it would be nice to have pytest send an lf so that it the pytest output doesn't run into our logging output, as you can see below.
Did you try the "-r" option? for example to report skip messages: -rs
> Below is a snippet of Jenkins console from one of our tests.
> 2012-12-19 03:15:19,224:module:lunacm:INFO:HSM init completed successfully
> testcases/rbs/test_backup_init.py:48: TestRBSInit.test_backup_factory_reset[remote] SKIPPED2012-12-19 03:15:19,239:module:lunacm:INFO:LunaCM destroyed...
> 2012-12-19 03:15:19,640:module:Install_Client:INFO: Uninstalling Luna Client running /bin/bash /usr/safenet/lunaclient/bin/uninstall.sh...
Hum, not sure i understand what's happening here. This seems to be
a py.test run in verbose mode? Why is it mixed with logging output?
Usually py.test would capture such output. IOW, could you give a bit more
context on how/what you are invoking here?
> The information contained in this electronic mail transmission
> may be privileged and confidential, and therefore, protected
> from disclosure. If you have received this communication in
> error, please notify us immediately by replying to this
> message and deleting it from your computer without copying
> or disclosing it.
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
More information about the testing-in-python