Skip to content

Commit

Permalink
Add extra debug infor for failing windows tests #685 #357
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Ombredanne <[email protected]>
  • Loading branch information
pombredanne authored and JonoYang committed Feb 1, 2018
1 parent 871263d commit 1da8313
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions tests/formattedcode/test_output_templated.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ def test_scan_html_output_does_not_truncate_copyright_html():
args = ['-clip', '--strip-root', '-n', '3', test_dir,
'--output-html', result_file]
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']

result = run_scan_click(args)
assert result.exit_code == 0
print('------------------------------------------------')
print(result.output)
print('------------------------------------------------')
assert 'Scanning done' in result.output

results = open(result_file).read()
Expand Down Expand Up @@ -130,6 +132,8 @@ def test_scan_html_output_does_not_truncate_copyright_html():
check = re.findall(exp, results, re.MULTILINE)
assert check

assert result.exit_code == 0


def test_custom_format_with_custom_filename_fails_for_directory():
test_dir = test_env.get_temp_dir('html')
Expand Down
14 changes: 7 additions & 7 deletions tests/scancode/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_license_option_detects_licenses():

args = ['--license', test_dir, '--json', result_file]
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
result = run_scan_click(args)
assert result.exit_code == 0
assert 'Scanning done' in result.output
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_scan_should_not_fail_on_faulty_pdf_or_pdfminer_bug_but_instead_report_e

args = ['--copyright', '--strip-root', test_file, '--json', result_file]
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
result = run_scan_click(args)
assert result.exit_code == 1
assert 'Scanning done' in result.output
Expand All @@ -257,7 +257,7 @@ def test_scan_with_errors_always_includes_full_traceback():

args = ['--copyright', test_file, '--json', result_file]
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
result = run_scan_click(args)
assert result.exit_code == 1
assert 'Scanning done' in result.output
Expand Down Expand Up @@ -551,7 +551,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr():
test_file = test_env.get_test_loc('errors', copy=True)
args = ['-pi', '-n', '0', test_file, '--json', '-']
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
rc, stdout, stderr = run_scan_plain(args)
assert rc == 1
assert 'Path: errors/package.json' in stderr
Expand All @@ -563,7 +563,7 @@ def test_scan_logs_errors_messages_not_verbosely_on_stderr_with_multiprocessing(
test_file = test_env.get_test_loc('errors', copy=True)
args = ['-pi', '-n', '2', test_file, '--json', '-']
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
rc, stdout, stderr = run_scan_plain(args)
assert rc == 1
assert 'Path: errors/package.json' in stderr
Expand All @@ -575,7 +575,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose():
test_file = test_env.get_test_loc('errors', copy=True)
args = ['-pi', '--verbose', '-n', '0', test_file, '--json', '-']
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
rc, stdout, stderr = run_scan_plain(args)
assert rc == 1
assert 'package.json' in stderr
Expand All @@ -588,7 +588,7 @@ def test_scan_logs_errors_messages_verbosely_with_verbose_and_multiprocessing():
test_file = test_env.get_test_loc('errors', copy=True)
args = ['-pi', '--verbose', '-n', '2', test_file, '--json', '-']
if on_windows:
args += ['--timeout', 400]
args += ['--timeout', '400']
rc, stdout, stderr = run_scan_plain(args)
assert rc == 1
assert 'package.json' in stderr
Expand Down

0 comments on commit 1da8313

Please sign in to comment.