April 24, 2021

How to Test Log Output With zope.testrunner

How to test log output with zope.testrunner? While pytest makes it very easy to work with log files via the caplog fixture, I was not aware how to test them with zope.testrunner, which is used for almost all Zope repositories. When I asked during yesterday’s Zope sprint, I got no answer. But coincidentally, I stumbled upon a broken doctest which… tests the log output of a function! So… thanks for failing… I guess :-)...

September 28, 2020

How to Run a Single Test

While this seems to be no Zope specific question, as we all know how to narrow down the test selection with pytest (e.g. pytest -k pattern), Zope does not use pytest, but zope.testrunner. Similar to pytest, also zope.testrunner offers some command line options, see https://zopetestrunner.readthedocs.io/en/latest/getting-started.html#some-useful-command-line-options-to-get-you-started This means, in order to run a specific test, you can use the -t flag, which takes one or more regex expressions as input, e.g. -t some_test....