Function
zope.testing.doctest.set_unittest_reportflags

Signature

set_unittest_reportflags(flags)

Documentation String

Sets the unittest option flags.

The old flag is returned so that a runner could restore the old value if it wished to:

>>> old = _unittest_reportflags
>>> set_unittest_reportflags(REPORT_NDIFF |
...                          REPORT_ONLY_FIRST_FAILURE) == old
True

# XXX this test fails and I didn't do it, so just commenting it out (JBY). # >>> import doctest # >>> doctest._unittest_reportflags == (REPORT_NDIFF | # ... REPORT_ONLY_FIRST_FAILURE) # True

Only reporting flags can be set:

>>> set_unittest_reportflags(ELLIPSIS)
Traceback (most recent call last):
...
ValueError: ('Only reporting flags allowed', 8)
>>> set_unittest_reportflags(old) == (REPORT_NDIFF |
...                                   REPORT_ONLY_FIRST_FAILURE)
True