Skip to content

Commit 2f5dd2b

Browse files
author
Matthias Koeppe
committed
sage --fixdoctests: Better messages when testing the doctester
1 parent 0ff47b2 commit 2f5dd2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bin/sage-fixdoctests

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,11 @@ def doctest_blocks(args, input_filenames, distribution=None, venv=None, environm
396396
if venv or environment_args:
397397
# Test the doctester, putting the output of the test into sage's temporary directory
398398
input = os.path.join(os.path.relpath(SAGE_ROOT), 'src', 'sage', 'version.py')
399-
cmdline = f'{shlex.quote(executable)} -t {environment_args}{long_args}{probe_args}{shlex.quote(input)}'
399+
cmdline = f'{shlex.quote(executable)} -t {environment_args}{long_args}{probe_args}'.rstrip()
400400
if cmdline not in tested_doctesters:
401-
print(f'Running "{cmdline}"')
401+
if args.verbose:
402+
print(f'sage-fixdoctests: Checking whether the doctester "{cmdline}" works')
403+
cmdline += f' {shlex.quote(input)}'
402404
if status := os.waitstatus_to_exitcode(os.system(f'{cmdline} > {shlex.quote(doc_file)}')):
403405
raise BadDistribution(f"Doctester exited with error status {status}")
404406
tested_doctesters.add(cmdline)

0 commit comments

Comments
 (0)