1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/abandoned_attribute_usage.py Sat Mar 19 22:46:02 2011 +0100
1.3 @@ -0,0 +1,31 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"""
1.7 +This test attempts to cause the recording of the usage of 'C' in the function
1.8 +'f'. Meanwhile, the methods 'D.g' and 'E.h' should be eliminated.
1.9 +"""
1.10 +
1.11 +class C:
1.12 + def f(self):
1.13 + return 1
1.14 +
1.15 +class D:
1.16 + def g(self): # unused
1.17 + return 2
1.18 +
1.19 +class E:
1.20 + def h(self): # unused
1.21 + return 3
1.22 +
1.23 +def f(c):
1.24 + if 1:
1.25 + return c.f()
1.26 + else:
1.27 + return 2
1.28 +
1.29 +c = C()
1.30 +d = D()
1.31 +e = E()
1.32 +result1_1 = f(c)
1.33 +
1.34 +# vim: tabstop=4 expandtab shiftwidth=4