1
testrunner handling of unexpected success
2
=========================================
4
Python 2.7 introduced the concept of expectedFailures to unittest.
5
See http://www.voidspace.org.uk/python/articles/unittest2.shtml#more-skipping
7
Although testrunner is currently not able to hande unexpected successes
8
correctly at least it does not report them as successes.
11
This document has some edge-case examples to test various aspects of
14
Separating Python path and test directories
15
-------------------------------------------
17
The --path option defines a directory to be searched for tests *and* a
18
directory to be added to Python's search path. The --test-path option
19
can be used when you want to set a test search path without also
20
affecting the Python path:
23
>>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex-719369')
25
>>> from zope import testrunner
28
... '--path', directory_with_tests,
29
... '--tests-pattern', '^sampletestsf?$',
31
>>> sys.argv = ['test']
32
>>> testrunner.run_internal(defaults)
33
... # doctest: +ELLIPSIS
34
Running zope.testrunner.layer.UnitTests tests:
35
Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
38
Error in test test_ef (sampletestsf.TestUnexpectedSuccess)
39
Traceback (most recent call last):
42
Ran 1 tests with 1 failures and 0 errors in N.NNN seconds.
43
Tearing down left over layers:
44
Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.