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

« back to all changes in this revision

Viewing changes to src/zope/testrunner/testrunner-ex/sample2/sampletests_ntds.py

  • 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
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2003 Zope Foundation and Contributors.
4
 
# All Rights Reserved.
5
 
#
6
 
# This software is subject to the provisions of the Zope Public License,
7
 
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
 
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
 
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
 
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
 
# FOR A PARTICULAR PURPOSE.
12
 
#
13
 
##############################################################################
14
 
"""Sample tests with a layer that can't be torn down
15
 
"""
16
 
 
17
 
import unittest
18
 
import doctest
19
 
 
20
 
class Layer:
21
 
 
22
 
    def setUp(self):
23
 
        pass
24
 
    setUp = classmethod(setUp)
25
 
 
26
 
    def tearDown(self):
27
 
        raise NotImplementedError
28
 
    tearDown = classmethod(tearDown)
29
 
 
30
 
class TestSomething(unittest.TestCase):
31
 
 
32
 
    layer = Layer
33
 
 
34
 
    def test_something(self):
35
 
        import pdb; pdb.set_trace()
36
 
 
37
 
    def test_something2(self):
38
 
        import pdb; pdb.set_trace()
39
 
 
40
 
    def test_something3(self):
41
 
        import pdb; pdb.set_trace()
42
 
 
43
 
    def test_something4(self):
44
 
        import pdb; pdb.set_trace()
45
 
 
46
 
    def test_something5(self):
47
 
        f()
48
 
 
49
 
def f():
50
 
    import pdb; pdb.set_trace()
51
 
 
52
 
def test_set_trace():
53
 
    """
54
 
    >>> if 1:
55
 
    ...     x = 1
56
 
    ...     import pdb; pdb.set_trace()
57
 
    """
58
 
    
59
 
def test_set_trace2():
60
 
    """
61
 
    >>> f()
62
 
    """
63
 
 
64
 
 
65
 
def test_suite():
66
 
    suite = unittest.TestSuite()
67
 
    suite.addTest(unittest.makeSuite(TestSomething))
68
 
    d = doctest.DocTestSuite()
69
 
    d.layer = Layer
70
 
    suite.addTest(d)
71
 
    return suite
72
 
 
73
 
 
74
 
if __name__ == '__main__':
75
 
    unittest.main()