1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/abandoned_attribute_usage_multiple_candidates.py Fri Feb 12 01:34:28 2010 +0100
1.3 @@ -0,0 +1,32 @@
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', alongside the expectation that 'D' might be used instead. A guard
1.9 +stipulating constraints for all of 'f' cannot therefore be generated. Meanwhile,
1.10 +the method 'E.h' should be eliminated.
1.11 +"""
1.12 +
1.13 +class C:
1.14 + def f(self):
1.15 + return 1
1.16 +
1.17 +class D:
1.18 + def g(self):
1.19 + return 2
1.20 +
1.21 +class E:
1.22 + def h(self): # unused
1.23 + return 3
1.24 +
1.25 +def f(c):
1.26 + if 1:
1.27 + return c.f()
1.28 + return c.g()
1.29 +
1.30 +c = C()
1.31 +d = D()
1.32 +e = E()
1.33 +result1_1 = f(c)
1.34 +
1.35 +# vim: tabstop=4 expandtab shiftwidth=4