@@ -129,14 +129,18 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
129129 expected = [3 , 4 , 1 ]
130130 sys_expected = ["sys 1" , "sys 2" ]
131131 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 } " )
132139 for line , exp in zip (
133140 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 ,
138142 ):
139- self .assertTrue (exp in line )
143+ self .assertTrue (exp in line , f" { exp } not in { line } " )
140144 else :
141145 self .assertTrue ("track" not in out .getvalue ().strip ())
142146 self .assertTrue ("system_cmd" not in out .getvalue ().strip ())
@@ -172,12 +176,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
172176 call_command (* command , "--all" , stdout = out )
173177 expected = [2 , 0 , 3 , 4 , 1 , 5 ]
174178 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 } " )
175186 for line , exp in zip (
176187 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 ,
181189 ):
182190 self .assertTrue (exp in line )
183191 else :
@@ -222,12 +230,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
222230 call_command (* command , "--demo" , stdout = out )
223231 expected = [2 , 3 , 4 , 1 , 5 ]
224232 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 } " )
225240 for line , exp in zip (
226241 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 ,
231243 ):
232244 self .assertTrue (exp in line )
233245 else :
@@ -265,12 +277,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
265277 call_command (* command , "--demo" , "--import" , stdout = out )
266278 expected = [2 , 0 , 3 , 4 , 1 , 5 ]
267279 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 } " )
268287 for line , exp in zip (
269288 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 ,
274290 ):
275291 self .assertTrue (exp in line )
276292 else :
@@ -315,12 +331,16 @@ def test_command(self, no_color=True, verbosity=None, subprocess=False):
315331 call_command (* command , "--import" , stdout = out )
316332 expected = [2 , 0 , 3 , 4 , 1 ]
317333 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 } " )
318341 for line , exp in zip (
319342 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 ,
324344 ):
325345 self .assertTrue (exp in line )
326346 else :
0 commit comments