1.1 --- a/tests/attr_providers.py Sat Nov 26 23:07:09 2016 +0100
1.2 +++ b/tests/attr_providers.py Sun Nov 27 00:33:50 2016 +0100
1.3 @@ -1,6 +1,7 @@
1.4 class C:
1.5 def __init__(self):
1.6 self.a = 1
1.7 + self.c = 3
1.8
1.9 b = 2
1.10
1.11 @@ -22,11 +23,35 @@
1.12
1.13 x.a = 7
1.14 x.b = 8
1.15 + return f(x)
1.16 +
1.17 +def h(x):
1.18 + x.c
1.19 + x.a = 4
1.20 + x.b
1.21 + return f(x)
1.22
1.23 c = C()
1.24 d = D()
1.25 e = E()
1.26
1.27 -result1 = f(c) # (1, 2)
1.28 -result2 = f(d) # (3, 4)
1.29 -result3 = f(e) # (5, 6)
1.30 +print f(c) # (1, 2)
1.31 +print f(d) # (3, 4)
1.32 +print f(e) # (5, 6)
1.33 +print f(E) # (5, 6)
1.34 +
1.35 +try:
1.36 + print g(c) # should fail with an error caused by a test
1.37 +except TypeError:
1.38 + print "g(c): c is not a suitable argument."
1.39 +
1.40 +print g(d) # (7, 8)
1.41 +
1.42 +try:
1.43 + print g(e) # should fail with an error caused by a test
1.44 +except TypeError:
1.45 + print "g(e): e is not a suitable argument."
1.46 +
1.47 +print g(E) # (7, 8)
1.48 +
1.49 +print h(c) # (4, 5)