mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
debug messages are now only active for non-test-results
This commit is contained in:
@@ -60,12 +60,16 @@ def run_definition_test(correct, source, line_nr, line, correct_start, path):
|
|||||||
continue
|
continue
|
||||||
# -1 for the comment, +3 because of the comment start `#? `
|
# -1 for the comment, +3 because of the comment start `#? `
|
||||||
start = index.start() + 3
|
start = index.start() + 3
|
||||||
|
if print_debug:
|
||||||
|
functions.set_debug_function(None)
|
||||||
try:
|
try:
|
||||||
should_be |= defs(line_nr - 1, start + correct_start)
|
should_be |= defs(line_nr - 1, start + correct_start)
|
||||||
except Exception:
|
except Exception:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
print('could not resolve %s indent %s' % (line_nr - 1, start))
|
print('could not resolve %s indent %s' % (line_nr - 1, start))
|
||||||
return 1
|
return 1
|
||||||
|
if print_debug:
|
||||||
|
functions.set_debug_function(debug.print_to_stdout)
|
||||||
# because the objects have different ids, `repr` it, then compare it.
|
# because the objects have different ids, `repr` it, then compare it.
|
||||||
should_str = sorted(str(r) for r in should_be)
|
should_str = sorted(str(r) for r in should_be)
|
||||||
is_str = sorted(set(str(r) for r in result))
|
is_str = sorted(set(str(r) for r in result))
|
||||||
@@ -207,12 +211,14 @@ try:
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
thirdparty = False
|
thirdparty = False
|
||||||
|
|
||||||
|
print_debug = False
|
||||||
try:
|
try:
|
||||||
i = args.index('--debug')
|
i = args.index('--debug')
|
||||||
args = args[:i] + args[i + 1:]
|
args = args[:i] + args[i + 1:]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
print_debug = True
|
||||||
functions.set_debug_function(debug.print_to_stdout)
|
functions.set_debug_function(debug.print_to_stdout)
|
||||||
|
|
||||||
# get test list, that should be executed
|
# get test list, that should be executed
|
||||||
|
|||||||
Reference in New Issue
Block a user