2013-10-08 | Paul Boddie | file changeset files shortlog | Supported relative imports in report output; made get_module_name a common function. | syspython-as-target |
paul@404 | 1 | #!/usr/bin/env python |
paul@404 | 2 | |
paul@404 | 3 | """ |
paul@404 | 4 | This test attempts to cause the recording of the usage of 'C' in the function |
paul@404 | 5 | 'f'. Meanwhile, the methods 'D.g' and 'E.h' should be eliminated. |
paul@404 | 6 | """ |
paul@404 | 7 | |
paul@404 | 8 | class C: |
paul@404 | 9 | def f(self): |
paul@404 | 10 | return 1 |
paul@404 | 11 | |
paul@404 | 12 | class D: |
paul@404 | 13 | def g(self): # unused |
paul@404 | 14 | return 2 |
paul@404 | 15 | |
paul@404 | 16 | class E: |
paul@404 | 17 | def h(self): # unused |
paul@404 | 18 | return 3 |
paul@404 | 19 | |
paul@404 | 20 | def f(c): |
paul@404 | 21 | if 1: |
paul@404 | 22 | return c.f() |
paul@404 | 23 | else: |
paul@404 | 24 | return 2 |
paul@404 | 25 | |
paul@404 | 26 | c = C() |
paul@404 | 27 | d = D() |
paul@404 | 28 | e = E() |
paul@404 | 29 | result1_1 = f(c) |
paul@404 | 30 | |
paul@404 | 31 | # vim: tabstop=4 expandtab shiftwidth=4 |