@@ -129,14 +129,18 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
129
129
expected = [3 , 4 , 1 ]
130
130
sys_expected = ["sys 1" , "sys 2" ]
131
131
if verbosity is None or verbosity > 0 :
132
+ expected_output = []
133
+ for exp in expected :
134
+ if not subprocess :
135
+ expected_output .append (f"track { exp } " )
136
+ expected_output .append (str (exp ))
137
+ for exp in sys_expected :
138
+ expected_output .append (f"system_cmd.py { exp } " )
132
139
for line , exp in zip (
133
140
self .lines (out .getvalue (), no_color = no_color ),
134
- [
135
- * [f"track { exp } " for exp in expected ],
136
- * [f"system_cmd.py { exp } " for exp in sys_expected ],
137
- ],
141
+ expected_output ,
138
142
):
139
- self .assertTrue (exp in line )
143
+ self .assertTrue (exp in line , f" { exp } not in { line } " )
140
144
else :
141
145
self .assertTrue ("track" not in out .getvalue ().strip ())
142
146
self .assertTrue ("system_cmd" not in out .getvalue ().strip ())
@@ -172,12 +176,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
172
176
call_command (* command , "--all" , stdout = out )
173
177
expected = [2 , 0 , 3 , 4 , 1 , 5 ]
174
178
if verbosity is None or verbosity > 0 :
179
+ expected_output = []
180
+ for exp in expected :
181
+ if not subprocess :
182
+ expected_output .append (f"track { exp } " )
183
+ expected_output .append (str (exp ))
184
+ for exp in sys_expected :
185
+ expected_output .append (f"system_cmd.py { exp } " )
175
186
for line , exp in zip (
176
187
self .lines (out .getvalue (), no_color = no_color ),
177
- [
178
- * [f"track { exp } " for exp in expected ],
179
- * [f"system_cmd.py { exp } " for exp in sys_expected ],
180
- ],
188
+ expected_output ,
181
189
):
182
190
self .assertTrue (exp in line )
183
191
else :
@@ -222,12 +230,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
222
230
call_command (* command , "--demo" , stdout = out )
223
231
expected = [2 , 3 , 4 , 1 , 5 ]
224
232
if verbosity is None or verbosity > 0 :
233
+ expected_output = []
234
+ for exp in expected :
235
+ if not subprocess :
236
+ expected_output .append (f"track { exp } " )
237
+ expected_output .append (str (exp ))
238
+ for exp in sys_expected :
239
+ expected_output .append (f"system_cmd.py { exp } " )
225
240
for line , exp in zip (
226
241
self .lines (out .getvalue (), no_color = no_color ),
227
- [
228
- * [f"track { exp } " for exp in expected ],
229
- * [f"system_cmd.py { exp } " for exp in sys_expected ],
230
- ],
242
+ expected_output ,
231
243
):
232
244
self .assertTrue (exp in line )
233
245
else :
@@ -265,12 +277,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
265
277
call_command (* command , "--demo" , "--import" , stdout = out )
266
278
expected = [2 , 0 , 3 , 4 , 1 , 5 ]
267
279
if verbosity is None or verbosity > 0 :
280
+ expected_output = []
281
+ for exp in expected :
282
+ if not subprocess :
283
+ expected_output .append (f"track { exp } " )
284
+ expected_output .append (str (exp ))
285
+ for exp in sys_expected :
286
+ expected_output .append (f"system_cmd.py { exp } " )
268
287
for line , exp in zip (
269
288
self .lines (out .getvalue (), no_color = no_color ),
270
- [
271
- * [f"track { exp } " for exp in expected ],
272
- * [f"system_cmd.py { exp } " for exp in sys_expected ],
273
- ],
289
+ expected_output ,
274
290
):
275
291
self .assertTrue (exp in line )
276
292
else :
@@ -315,12 +331,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
315
331
call_command (* command , "--import" , stdout = out )
316
332
expected = [2 , 0 , 3 , 4 , 1 ]
317
333
if verbosity is None or verbosity > 0 :
334
+ expected_output = []
335
+ for exp in expected :
336
+ if not subprocess :
337
+ expected_output .append (f"track { exp } " )
338
+ expected_output .append (str (exp ))
339
+ for exp in sys_expected :
340
+ expected_output .append (f"system_cmd.py { exp } " )
318
341
for line , exp in zip (
319
342
self .lines (out .getvalue (), no_color = no_color ),
320
- [
321
- * [f"track { exp } " for exp in expected ],
322
- * [f"system_cmd.py { exp } " for exp in sys_expected ],
323
- ],
343
+ expected_output ,
324
344
):
325
345
self .assertTrue (exp in line )
326
346
else :
0 commit comments