1 | #!/usr/bin/env python2
|
2 | """
|
3 | dataflow_testing.py
|
4 | """
|
5 | from __future__ import print_function
|
6 |
|
7 | import os
|
8 | from typing import Any, Dict, List, Tuple
|
9 |
|
10 |
|
11 | class ObjectA(object):
|
12 |
|
13 | def __init__(self, a, b):
|
14 | # type: (int, Tuple[int, int]) -> None
|
15 | self.a = a
|
16 | x, y = b
|
17 | self.list = [x * y] # type: List[int]
|
18 |
|
19 |
|
20 | class ObjectB(object):
|
21 |
|
22 | def __init__(self):
|
23 | # type: () -> None
|
24 | self.dict = {} # type: Dict[str, List[int]]
|
25 |
|
26 |
|
27 | class ctx_Noop(object):
|
28 |
|
29 | def __init__(self):
|
30 | # type: () -> None
|
31 | pass
|
32 |
|
33 | def __enter__(self):
|
34 | # type: () -> None
|
35 | pass
|
36 |
|
37 | def __exit__(self, type, value, traceback):
|
38 | # type: (Any, Any, Any) -> None
|
39 | pass
|
40 |
|
41 |
|
42 | def run_tests():
|
43 | # type: () -> None
|
44 | a = ObjectA(1, (2, 3))
|
45 | obj_b = ObjectB()
|
46 | obj_b.dict['key'] = a.list
|
47 |
|
48 | b = a
|
49 |
|
50 | try:
|
51 | with ctx_Noop() as ctx:
|
52 | c = b
|
53 |
|
54 | except AssertionError:
|
55 | d = c
|
56 |
|
57 | if 0:
|
58 | e = d
|
59 |
|
60 | l = [None, None, None] # type: List[ObjectA]
|
61 | for i in xrange(0, 3):
|
62 | if os.getenv('var') is not None:
|
63 | pass
|
64 | else:
|
65 | l[i] = b
|
66 |
|
67 | if __name__ == '__main__':
|
68 | if os.getenv('BENCHMARK'):
|
69 | pass
|
70 | else:
|
71 | run_tests()
|