|
31 | 31 |
|
32 | 32 | # noinspection PyTypeChecker |
33 | 33 | HIERARCHY_TEST_VARIABLES = \ |
34 | | - [dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True}, |
35 | | - **utils.DEFAULT_VARIABLES)] * 6 + \ |
36 | | - [ |
37 | | - dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, |
38 | | - 'rp_hierarchy_dirs_level': 1}, **utils.DEFAULT_VARIABLES), |
39 | | - dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, |
40 | | - 'rp_hierarchy_dirs_level': 2}, **utils.DEFAULT_VARIABLES), |
41 | | - dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, |
42 | | - 'rp_hierarchy_dirs_level': 999}, **utils.DEFAULT_VARIABLES), |
43 | | - dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, |
44 | | - 'rp_hierarchy_dirs_level': -1}, **utils.DEFAULT_VARIABLES), |
45 | | - dict({'rp_hierarchy_dir_path_separator': '/', |
46 | | - 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
47 | | - dict({'rp_hierarchy_dir_path_separator': '\\', |
48 | | - 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
49 | | - dict({'rp_hierarchy_dirs_level': 1, 'rp_hierarchy_code': True, |
50 | | - }, **utils.DEFAULT_VARIABLES), |
51 | | - dict({'rp_hierarchy_dirs_level': 2, 'rp_hierarchy_code': True, |
52 | | - }, **utils.DEFAULT_VARIABLES), |
53 | | - dict({'rp_hierarchy_dirs_level': 999, 'rp_hierarchy_code': True, |
54 | | - }, **utils.DEFAULT_VARIABLES), |
55 | | - dict({'rp_hierarchy_dirs_level': -1, 'rp_hierarchy_code': True, |
56 | | - }, **utils.DEFAULT_VARIABLES), |
| 34 | + [dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES)] * 6 + \ |
| 35 | + [ |
| 36 | + dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, 'rp_hierarchy_dirs_level': 1}, |
| 37 | + **utils.DEFAULT_VARIABLES), |
| 38 | + dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, 'rp_hierarchy_dirs_level': 2}, |
| 39 | + **utils.DEFAULT_VARIABLES), |
| 40 | + dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, 'rp_hierarchy_dirs_level': 999}, |
| 41 | + **utils.DEFAULT_VARIABLES), |
| 42 | + dict({'rp_hierarchy_dirs': True, 'rp_hierarchy_code': True, 'rp_hierarchy_dirs_level': -1}, |
| 43 | + **utils.DEFAULT_VARIABLES), |
| 44 | + dict({'rp_hierarchy_dir_path_separator': '/', 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
| 45 | + dict({'rp_hierarchy_dir_path_separator': '\\', 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
| 46 | + dict({'rp_hierarchy_dirs_level': 1, 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
| 47 | + dict({'rp_hierarchy_dirs_level': 2, 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
| 48 | + dict({'rp_hierarchy_dirs_level': 999, 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
| 49 | + dict({'rp_hierarchy_dirs_level': -1, 'rp_hierarchy_code': True}, **utils.DEFAULT_VARIABLES), |
57 | 50 | dict(**utils.DEFAULT_VARIABLES), |
58 | 51 | dict(**utils.DEFAULT_VARIABLES), |
59 | 52 | dict({'rp_hierarchy_test_file': False}, **utils.DEFAULT_VARIABLES), |
|
62 | 55 |
|
63 | 56 | HIERARCHY_TEST_EXPECTED_ITEMS = [ |
64 | 57 | [ |
65 | | - {'name': 'examples', 'item_type': 'SUITE', |
66 | | - 'parent_item_id': lambda x: x is None}, |
67 | | - {'name': 'test_simple.py', 'item_type': 'SUITE', |
68 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
69 | | - {'name': 'test_simple', 'item_type': 'STEP', |
70 | | - 'parent_item_id': lambda x: x.startswith('test_simple.py')} |
| 58 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 59 | + {'name': 'test_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
| 60 | + {'name': 'test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('test_simple.py')} |
71 | 61 | ], |
72 | 62 | [ |
73 | | - {'name': 'examples', 'item_type': 'SUITE', |
74 | | - 'parent_item_id': lambda x: x is None}, |
75 | | - {'name': 'hierarchy', 'item_type': 'SUITE', |
76 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
77 | | - {'name': 'inner', 'item_type': 'SUITE', |
78 | | - 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
79 | | - {'name': 'test_inner_simple.py', 'item_type': 'SUITE', |
80 | | - 'parent_item_id': lambda x: x.startswith('inner')}, |
81 | | - {'name': 'test_simple', 'item_type': 'STEP', |
82 | | - 'parent_item_id': lambda x: x.startswith('test_inner_simple.py')} |
| 63 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 64 | + {'name': 'hierarchy', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
| 65 | + {'name': 'inner', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
| 66 | + {'name': 'test_inner_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('inner')}, |
| 67 | + {'name': 'test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('test_inner_simple.py')} |
83 | 68 | ], |
84 | 69 | [ |
85 | | - {'name': 'examples', 'item_type': 'SUITE', |
86 | | - 'parent_item_id': lambda x: x is None}, |
87 | | - {'name': 'hierarchy', 'item_type': 'SUITE', |
88 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
89 | | - {'name': 'test_in_class.py', 'item_type': 'SUITE', |
90 | | - 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
91 | | - {'name': 'Tests', 'item_type': 'SUITE', |
92 | | - 'parent_item_id': lambda x: x.startswith('test_in_class.py')}, |
93 | | - {'name': 'test_in_class', 'item_type': 'STEP', |
94 | | - 'parent_item_id': lambda x: x.startswith('Tests')} |
| 70 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 71 | + {'name': 'hierarchy', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
| 72 | + {'name': 'test_in_class.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
| 73 | + {'name': 'Tests', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('test_in_class.py')}, |
| 74 | + {'name': 'test_in_class', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('Tests')} |
95 | 75 | ], |
96 | 76 | [ |
97 | | - {'name': 'examples', 'item_type': 'SUITE', |
98 | | - 'parent_item_id': lambda x: x is None}, |
99 | | - {'name': 'hierarchy', 'item_type': 'SUITE', |
100 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
| 77 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 78 | + {'name': 'hierarchy', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
101 | 79 | {'name': 'test_in_class_in_class.py', 'item_type': 'SUITE', |
102 | 80 | 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
103 | 81 | {'name': 'Tests', 'item_type': 'SUITE', |
104 | | - 'parent_item_id': lambda x: |
105 | | - x.startswith('test_in_class_in_class.py')}, |
106 | | - {'name': 'Test', 'item_type': 'SUITE', |
107 | | - 'parent_item_id': lambda x: x.startswith('Tests')}, |
108 | | - {'name': 'test_in_class_in_class', 'item_type': 'STEP', |
109 | | - 'parent_item_id': lambda x: x.startswith('Test')} |
| 82 | + 'parent_item_id': lambda x: x.startswith('test_in_class_in_class.py')}, |
| 83 | + {'name': 'Test', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('Tests')}, |
| 84 | + {'name': 'test_in_class_in_class', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('Test')} |
110 | 85 | ], |
111 | 86 | [ |
112 | | - {'name': 'examples', 'item_type': 'SUITE', |
113 | | - 'parent_item_id': lambda x: x is None}, |
114 | | - {'name': 'hierarchy', 'item_type': 'SUITE', |
115 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
116 | | - {'name': 'another_inner', 'item_type': 'SUITE', |
117 | | - 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
| 87 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 88 | + {'name': 'hierarchy', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
| 89 | + {'name': 'another_inner', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
118 | 90 | {'name': 'test_another_inner_simple.py', 'item_type': 'SUITE', |
119 | 91 | 'parent_item_id': lambda x: x.startswith('another_inner')}, |
120 | 92 | {'name': 'test_simple', 'item_type': 'STEP', |
121 | | - 'parent_item_id': lambda x: x.startswith( |
122 | | - 'test_another_inner_simple.py')}, |
123 | | - {'name': 'inner', 'item_type': 'SUITE', |
124 | | - 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
125 | | - {'name': 'test_inner_simple.py', 'item_type': 'SUITE', |
126 | | - 'parent_item_id': lambda x: x.startswith('inner')}, |
127 | | - {'name': 'test_simple', 'item_type': 'STEP', |
128 | | - 'parent_item_id': lambda x: x.startswith('test_inner_simple.py')} |
| 93 | + 'parent_item_id': lambda x: x.startswith('test_another_inner_simple.py')}, |
| 94 | + {'name': 'inner', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('hierarchy')}, |
| 95 | + {'name': 'test_inner_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('inner')}, |
| 96 | + {'name': 'test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('test_inner_simple.py')} |
129 | 97 | ], |
130 | 98 | [ |
131 | | - {'name': 'examples', 'item_type': 'SUITE', |
132 | | - 'parent_item_id': lambda x: x is None}, |
133 | | - {'name': 'params', 'item_type': 'SUITE', |
134 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
| 99 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 100 | + {'name': 'params', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
135 | 101 | {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', |
136 | 102 | 'parent_item_id': lambda x: x.startswith('params')}, |
137 | 103 | {'name': 'Tests', 'item_type': 'SUITE', |
138 | | - 'parent_item_id': lambda x: x.startswith( |
139 | | - 'test_in_class_parameterized.py')}, |
| 104 | + 'parent_item_id': lambda x: x.startswith('test_in_class_parameterized.py')}, |
140 | 105 | {'name': 'test_in_class_parameterized[param]', 'item_type': 'STEP', |
141 | 106 | 'parent_item_id': lambda x: x.startswith('Tests')} |
142 | 107 | ], |
143 | 108 | [ |
144 | | - {'name': 'params', 'item_type': 'SUITE', |
145 | | - 'parent_item_id': lambda x: x is None}, |
| 109 | + {'name': 'params', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
146 | 110 | {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', |
147 | 111 | 'parent_item_id': lambda x: x.startswith('params')}, |
148 | 112 | {'name': 'Tests', 'item_type': 'SUITE', |
149 | | - 'parent_item_id': lambda x: x.startswith( |
150 | | - 'test_in_class_parameterized.py')}, |
| 113 | + 'parent_item_id': lambda x: x.startswith('test_in_class_parameterized.py')}, |
151 | 114 | {'name': 'test_in_class_parameterized[param]', 'item_type': 'STEP', |
152 | 115 | 'parent_item_id': lambda x: x.startswith('Tests')} |
153 | 116 | ], |
154 | 117 | [ |
155 | | - {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', |
156 | | - 'parent_item_id': lambda x: x is None}, |
| 118 | + {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
157 | 119 | {'name': 'Tests', 'item_type': 'SUITE', |
158 | | - 'parent_item_id': lambda x: x.startswith( |
159 | | - 'test_in_class_parameterized.py')}, |
| 120 | + 'parent_item_id': lambda x: x.startswith('test_in_class_parameterized.py')}, |
160 | 121 | {'name': 'test_in_class_parameterized[param]', 'item_type': 'STEP', |
161 | 122 | 'parent_item_id': lambda x: x.startswith('Tests')} |
162 | 123 | ], |
163 | 124 | [ |
164 | | - {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', |
165 | | - 'parent_item_id': lambda x: x is None}, |
| 125 | + {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
166 | 126 | {'name': 'Tests', 'item_type': 'SUITE', |
167 | | - 'parent_item_id': lambda x: x.startswith( |
168 | | - 'test_in_class_parameterized.py')}, |
| 127 | + 'parent_item_id': lambda x: x.startswith('test_in_class_parameterized.py')}, |
169 | 128 | {'name': 'test_in_class_parameterized[param]', 'item_type': 'STEP', |
170 | 129 | 'parent_item_id': lambda x: x.startswith('Tests')} |
171 | 130 | ], |
172 | 131 | [ |
173 | | - {'name': 'examples', 'item_type': 'SUITE', |
174 | | - 'parent_item_id': lambda x: x is None}, |
175 | | - {'name': 'params', 'item_type': 'SUITE', |
176 | | - 'parent_item_id': lambda x: x.startswith('examples')}, |
| 132 | + {'name': 'examples', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 133 | + {'name': 'params', 'item_type': 'SUITE', 'parent_item_id': lambda x: x.startswith('examples')}, |
177 | 134 | {'name': 'test_in_class_parameterized.py', 'item_type': 'SUITE', |
178 | 135 | 'parent_item_id': lambda x: x.startswith('params')}, |
179 | 136 | {'name': 'Tests', 'item_type': 'SUITE', |
180 | | - 'parent_item_id': lambda x: x.startswith( |
181 | | - 'test_in_class_parameterized.py')}, |
| 137 | + 'parent_item_id': lambda x: x.startswith('test_in_class_parameterized.py')}, |
182 | 138 | {'name': 'test_in_class_parameterized[param]', 'item_type': 'STEP', |
183 | 139 | 'parent_item_id': lambda x: x.startswith('Tests')} |
184 | 140 | ], |
185 | 141 | [ |
186 | | - {'name': 'examples/hierarchy/inner/test_inner_simple.py', |
187 | | - 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 142 | + {'name': 'examples/hierarchy/inner/test_inner_simple.py', 'item_type': 'SUITE', |
| 143 | + 'parent_item_id': lambda x: x is None}, |
188 | 144 | {'name': 'test_simple', 'item_type': 'STEP', |
189 | | - 'parent_item_id': |
190 | | - lambda x: |
191 | | - x.startswith('examples/hierarchy/inner/test_inner_simple.py')} |
| 145 | + 'parent_item_id': lambda x: x.startswith('examples/hierarchy/inner/test_inner_simple.py')} |
192 | 146 | ], |
193 | 147 | [ |
194 | | - {'name': 'examples\\hierarchy\\inner\\test_inner_simple.py', |
195 | | - 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 148 | + {'name': 'examples\\hierarchy\\inner\\test_inner_simple.py', 'item_type': 'SUITE', |
| 149 | + 'parent_item_id': lambda x: x is None}, |
196 | 150 | {'name': 'test_simple', 'item_type': 'STEP', |
197 | | - 'parent_item_id': |
198 | | - lambda x: |
199 | | - x.startswith('examples\\hierarchy\\inner\\test_inner_simple.py')} |
| 151 | + 'parent_item_id': lambda x: x.startswith('examples\\hierarchy\\inner\\test_inner_simple.py')} |
200 | 152 | ], |
201 | 153 | [ |
202 | | - {'name': 'hierarchy/inner/test_inner_simple.py', |
203 | | - 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 154 | + {'name': 'hierarchy/inner/test_inner_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
204 | 155 | {'name': 'test_simple', 'item_type': 'STEP', |
205 | | - 'parent_item_id': |
206 | | - lambda x: |
207 | | - x.startswith('hierarchy/inner/test_inner_simple.py')} |
| 156 | + 'parent_item_id': lambda x: x.startswith('hierarchy/inner/test_inner_simple.py')} |
208 | 157 | ], |
209 | 158 | [ |
210 | | - {'name': 'inner/test_inner_simple.py', |
211 | | - 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 159 | + {'name': 'inner/test_inner_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
212 | 160 | {'name': 'test_simple', 'item_type': 'STEP', |
213 | | - 'parent_item_id': |
214 | | - lambda x: |
215 | | - x.startswith('inner/test_inner_simple.py')} |
| 161 | + 'parent_item_id': lambda x: x.startswith('inner/test_inner_simple.py')} |
216 | 162 | ], |
217 | 163 | [ |
218 | | - {'name': 'test_inner_simple.py', |
219 | | - 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
220 | | - {'name': 'test_simple', 'item_type': 'STEP', |
221 | | - 'parent_item_id': |
222 | | - lambda x: |
223 | | - x.startswith('test_inner_simple.py')} |
| 164 | + {'name': 'test_inner_simple.py', 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
| 165 | + {'name': 'test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x.startswith('test_inner_simple.py')} |
224 | 166 | ], |
225 | 167 | [ |
226 | 168 | {'name': 'examples/hierarchy/inner/test_inner_simple.py', |
227 | 169 | 'item_type': 'SUITE', 'parent_item_id': lambda x: x is None}, |
228 | 170 | {'name': 'test_simple', 'item_type': 'STEP', |
229 | | - 'parent_item_id': |
230 | | - lambda x: |
231 | | - x.startswith('examples/hierarchy/inner/test_inner_simple.py')} |
| 171 | + 'parent_item_id': lambda x: x.startswith('examples/hierarchy/inner/test_inner_simple.py')} |
232 | 172 | ], |
233 | 173 | [ |
234 | | - {'name': 'examples/hierarchy/inner/test_inner_simple.py::test_simple', |
235 | | - 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
| 174 | + {'name': 'examples/hierarchy/inner/test_inner_simple.py::test_simple', 'item_type': 'STEP', |
| 175 | + 'parent_item_id': lambda x: x is None} |
236 | 176 | ], |
237 | 177 | [ |
238 | | - {'name': 'examples/hierarchy/test_in_class_in_class.py::Tests::Test' |
239 | | - '::test_in_class_in_class', |
| 178 | + {'name': 'examples/hierarchy/test_in_class_in_class.py::Tests::Test::test_in_class_in_class', |
240 | 179 | 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
241 | 180 | ], |
242 | 181 | [ |
243 | | - {'name': 'examples/test_simple', |
244 | | - 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
| 182 | + {'name': 'examples/test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
245 | 183 | ], |
246 | 184 | [ |
247 | | - {'name': 'test_simple', |
248 | | - 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
| 185 | + {'name': 'test_simple', 'item_type': 'STEP', 'parent_item_id': lambda x: x is None} |
249 | 186 | ] |
250 | 187 | ] |
251 | 188 |
|
|
0 commit comments