enable debug logging inside the test suite
ClosedPublic

Authored by kparal on Mar 27 2014, 2:04 PM.

Details

Summary

When some test fails, it will now display the logged output as part of
stderr. Also it's now possible to display logged output even for passed
tests using py.test -s option. This is sometimes very handy, so keep this in mind! :-)

Test Plan

Unfortunatelly I can't demonstrate it at the moment too much, because we don't use much debug logging in libtaskotron. But with the upcoming config.py, this is making miracles. For any failed test, you also see any logged output as captured by py.test. That helps to discover the issue greatly.

You can also run something like py.test --functional -s testing/test_check.py (notice -s) and you'll see full output even for passed tests, not just failing ones. Again, this can be used to verify that your test is executing the correct code paths.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Overall, looks good. Any thoughts about removing sys._called_from_test?

testing/conftest.py
50–58

This is still a hack but we're not using it, so I propose that we remove it

Overall, looks good. Any thoughts about removing sys._called_from_test?

I did that in D34. I can do it as part of this patch, why not.

kparal updated this revision.Mar 27 2014, 7:29 PM
  • remove sys hack
tflink accepted this revision.Mar 28 2014, 7:40 AM

I did that in D34. I can do it as part of this patch, why not.

Either way works. Looks good to me, please squash and merge into develop

kparal closed this revision.Mar 28 2014, 7:45 AM

Closed by commit rLTRN8158705593ea (authored by @kparal).