~ztk-steering-group/zope.testrunner/trunk

« back to all changes in this revision

Viewing changes to src/zope/testrunner/testrunner-unexpected-success.txt

  • Committer: mgedmin
  • Date: 2013-02-11 20:02:43 UTC
  • Revision ID: svn-v4:62d5b8a3-27da-0310-9561-8e5933582275:zope.testrunner/trunk:129304
Moved to github

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
testrunner handling of unexpected success
2
 
=========================================
3
 
 
4
 
Python 2.7 introduced the concept of expectedFailures to unittest.
5
 
See http://www.voidspace.org.uk/python/articles/unittest2.shtml#more-skipping
6
 
 
7
 
Although testrunner is currently not able to hande unexpected successes
8
 
correctly at least it does not report them as successes.
9
 
 
10
 
 
11
 
This document has some edge-case examples to test various aspects of
12
 
the test runner.
13
 
 
14
 
Separating Python path and test directories
15
 
-------------------------------------------
16
 
 
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:
21
 
 
22
 
    >>> import os, sys
23
 
    >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex-719369')
24
 
 
25
 
    >>> from zope import testrunner
26
 
 
27
 
    >>> defaults = [
28
 
    ...     '--path', directory_with_tests,
29
 
    ...     '--tests-pattern', '^sampletestsf?$',
30
 
    ...     ]
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.
36
 
    <BLANKLINE>
37
 
    <BLANKLINE>
38
 
    Error in test test_ef (sampletestsf.TestUnexpectedSuccess)
39
 
    Traceback (most recent call last):
40
 
    ..._UnexpectedSuccess
41
 
    <BLANKLINE>
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.
45
 
    True