Help fixing doctest warnings

112 views
Skip to first unread message

David Coudert

unread,
Dec 17, 2023, 4:50:05 AM12/17/23
to sage-devel
Dear all,

I observe some doctest warnings that I don't know how to fix.  This is certainly a side effect of the modularization.

File "src/sage/plot/plot.py", line 569, in sage.plot.plot
Warning: Variable 'sig_on_count' referenced here was set only in doctest marked '# needs sage.symbolic'
    sig_on_count() # check sig_on/off pairings (virtual doctest)
**********************************************************************
File "src/sage/plot/plot.py", line 3623, in sage.plot.plot.graphics_array
Warning: Variable 'x' referenced here was set only in doctest marked '# long time, needs sage.symbolic'
    L = [plot(sin(k*x), (x,-pi,pi)) for k in [1..3]]
**********************************************************************
File "src/sage/plot/plot.py", line 3669, in sage.plot.plot.graphics_array
Warning: Variable 'x' referenced here was set only in doctest marked '# long time, needs sage.symbolic'
    p1 = plot(sin(x^2), (x, 0, 6),
              axes_labels=[r'$\theta$', r'$\sin(\theta^2)$'], fontsize=16)
**********************************************************************
File "src/sage/plot/plot.py", line 3671, in sage.plot.plot.graphics_array
Warning: Variable 'x' referenced here was set only in doctest marked '# long time, needs sage.symbolic'
    p2 = plot(x^3, (x, 1, 100), axes_labels=[r'$x$', r'$y$'],
              scale='semilogy', frame=True, gridlines='minor')


File "src/sage/repl/user_globals.py", line 52, in sage.repl.user_globals
Warning: Variable 'sig_on_count' referenced here was set only in doctest marked '# needs sage.modules'
    sig_on_count() # check sig_on/off pairings (virtual doctest)
**********************************************************************
File "src/sage/repl/user_globals.py", line 99, in sage.repl.user_globals.get_globals
Warning: Variable 'sig_on_count' referenced here was set only in doctest marked '# needs sage.modules'
    sig_on_count() # check sig_on/off pairings (virtual doctest)


Kwankyu Lee

unread,
Dec 19, 2023, 6:41:32 AM12/19/23
to sage-devel
Hi,

The string "sig_on_count() # check sig_on/off pairings (virtual doctest)" is from src/sage/doctest/sources.py line 234.
As I understand it, the warning is caused by a bug in the method _create_doctests() in the same file, which fails to add optional tags correctly to the string.

Matthias would know better.

Kwankyu Lee

unread,
Dec 19, 2023, 6:49:45 AM12/19/23
to sage-devel
Reply all
Reply to author
Forward
0 new messages