Skip to content

Commit 681bbee

Browse files
committed
Avoid failures in failure reporting
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent f31d0ef commit 681bbee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/scancode/test_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,12 @@ def test_scan_works_with_no_processes_in_threaded_mode():
318318
# run the same scan with zero or one process
319319
result_file_0 = test_env.get_temp_file('json')
320320
args = ['--copyright', '--processes', '0', test_dir, '--json', result_file_0]
321+
result0 = None
321322
try:
322323
result0 = run_scan_click(args)
323324
except Exception as e:
324325
print('Failed to run "test_scan_works_with_no_processes_in_threaded_mode" randomly. Ignoring failure: {e!r}')
325-
assert 'Disabling multi-processing' in result0.output
326+
assert result0 and 'Disabling multi-processing' in result0.output
326327

327328
result_file_1 = test_env.get_temp_file('json')
328329
args = ['--copyright', '--processes', '1', test_dir, '--json', result_file_1]

0 commit comments

Comments
 (0)