Package logilab :: Package common :: Package test :: Module xtest_foo
[frames] | no frames]

Source Code for Module logilab.common.test.xtest_foo

 1  from logilab.common.testlib import TestCase, unittest_main 
 2   
3 -def f():
4 g()
5
6 -def g():
7 int(s1)
8 9
10 -def h(x):
11 return i(x)
12
13 -def i(x):
14 check(x)
15
16 -def check(x):
17 assert x <= 3
18
19 -class Foo(TestCase):
20 - def test_1(self):
21 f() 22 self.assertRaises(ValueError, f)
23
24 - def setUp(self):
25 print 'setup'
26
27 - def test_2(self):
28 for x in xrange(5): 29 yield h, x
30
31 - def tearDown(self):
32 print 'teardown'
33