~landscape/zope3/ztk-1.1.3

« back to all changes in this revision

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

  • Committer: Thomas Hervé
  • Date: 2009-09-21 06:45:37 UTC
  • mfrom: (7.1.2 newer-zope-testing)
  • Revision ID: thomas@canonical.com-20090921064537-zcfyuv32hxj9eah0
Merge newer-zope-testing [a=sidnei] [f=429702] [r=therve,free.ekayanaka]

Update zope.testing to 3.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2003 Zope Corporation and Contributors.
4
 
# All Rights Reserved.
5
 
#
6
 
# This software is subject to the provisions of the Zope Public License,
7
 
# Version 2.0 (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
 
$Id: sampletests_ntds.py 33295 2005-07-13 12:02:58Z jim $
17
 
"""
18
 
 
19
 
import unittest
20
 
from zope.testing import doctest
21
 
 
22
 
class Layer:
23
 
 
24
 
    def setUp(self):
25
 
        pass
26
 
    setUp = classmethod(setUp)
27
 
 
28
 
    def tearDown(self):
29
 
        raise NotImplementedError
30
 
    tearDown = classmethod(tearDown)
31
 
 
32
 
class TestSomething(unittest.TestCase):
33
 
 
34
 
    layer = Layer
35
 
 
36
 
    def test_something(self):
37
 
        import pdb; pdb.set_trace()
38
 
 
39
 
    def test_something2(self):
40
 
        import pdb; pdb.set_trace()
41
 
 
42
 
    def test_something3(self):
43
 
        import pdb; pdb.set_trace()
44
 
 
45
 
    def test_something4(self):
46
 
        import pdb; pdb.set_trace()
47
 
 
48
 
    def test_something5(self):
49
 
        f()
50
 
 
51
 
def f():
52
 
    import pdb; pdb.set_trace()
53
 
 
54
 
def test_set_trace():
55
 
    """
56
 
    >>> if 1:
57
 
    ...     x = 1
58
 
    ...     import pdb; pdb.set_trace()
59
 
    """
60
 
    
61
 
def test_set_trace2():
62
 
    """
63
 
    >>> f()
64
 
    """
65
 
 
66
 
 
67
 
def test_suite():
68
 
    suite = unittest.TestSuite()
69
 
    suite.addTest(unittest.makeSuite(TestSomething))
70
 
    d = doctest.DocTestSuite()
71
 
    d.layer = Layer
72
 
    suite.addTest(d)
73
 
    return suite
74
 
 
75
 
 
76
 
if __name__ == '__main__':
77
 
    unittest.main()