diff --git a/src/scancode/cli.py b/src/scancode/cli.py index 1e189c89641..add654f2ec4 100644 --- a/src/scancode/cli.py +++ b/src/scancode/cli.py @@ -480,6 +480,8 @@ def scancode( if check_version: from scancode.outdated import check_scancode_version outdated = check_scancode_version() + else: + outdated = None # run proper success, _results = run_scan( diff --git a/tests/scancode/test_cli.py b/tests/scancode/test_cli.py index 93d56ba0d93..e537002af6c 100644 --- a/tests/scancode/test_cli.py +++ b/tests/scancode/test_cli.py @@ -121,6 +121,12 @@ def test_run_scan_includes_outdated_in_extra(): assert results['headers'][0]['extra_data']['OUTDATED'] == 'out of date' +def test_no_version_check_run_is_successful(): + test_file = test_env.get_test_loc('single/iproute.c') + result_file = test_env.get_temp_file('json') + run_scan_click(['--no-check-version', test_file, '--json', result_file], expected_rc=0) + + def test_usage_and_help_return_a_correct_script_name_on_all_platforms(): result = run_scan_click(['--help']) assert 'Usage: scancode [OPTIONS]' in result.output