~landscape/zope3/ztk-1.1.3

« back to all changes in this revision

Viewing changes to src/zope/testing/testrunner-ex/sample3/sampletests_ntd.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_ntd.py 33278 2005-07-12 11:45:54Z jim $
17
 
"""
18
 
 
19
 
import unittest
20
 
 
21
 
class Layer:
22
 
 
23
 
    def setUp(self):
24
 
        pass
25
 
    setUp = classmethod(setUp)
26
 
 
27
 
    def tearDown(self):
28
 
        raise NotImplementedError
29
 
    tearDown = classmethod(tearDown)
30
 
 
31
 
class TestSomething(unittest.TestCase):
32
 
 
33
 
    layer = Layer
34
 
 
35
 
    def test_something(self):
36
 
        pass
37
 
 
38
 
    def test_something_else(self):
39
 
        pass
40
 
 
41
 
    def test_error1(self):
42
 
        raise TypeError("Can we see errors")
43
 
 
44
 
    def test_error2(self):
45
 
        raise TypeError("I hope so")
46
 
 
47
 
    def test_fail1(self):
48
 
        self.assertEqual(1, 2)
49
 
 
50
 
    def test_fail2(self):
51
 
        self.assertEqual(1, 3)
52
 
 
53
 
 
54
 
def test_suite():
55
 
    suite = unittest.TestSuite()
56
 
    suite.addTest(unittest.makeSuite(TestSomething))
57
 
    return suite
58
 
 
59
 
 
60
 
if __name__ == '__main__':
61
 
    unittest.main()