Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[probably fixed] bug in doctesting -- long time not respected in some contexts #1866

Closed
williamstein opened this issue Jan 20, 2008 · 2 comments

Comments

@williamstein
Copy link
Contributor

On Jan 20, 2008 7:28 AM, Lars Fischer <> wrote:
> 
> Hello,
> 
> I think I have found a bug:
> chapter 2.4.1 of the Programming guide states, that comments like "#
> long time (!)"  prevents the example from being tested.

Yep, that is a bug.  I've made it. 

> 
> But:
> sage -t quadratic-modules.sage
> sage -t  quadratic-modules.sage
> Example 13 (line 433)
> TIMEOUT!!
> IN:
>  phi.level()
>  phi = fqmodule([11,33]);
>  phi.tau_invariant()
>  phi = fqmodule([11,33]); # long time (!)
>  phi.sigma_invariant()    # long time (!)
> OUT:
> 
> 
> This applies to sage 2.10.
> 
> I think the reason is:
> sage -t calls
> sage-sage and then
> sage-test, which in turns calls
> sage-doctest_tex, if extension is ".sage" instead of sage-doctest.
> 
> At least sage-doctest looks for "long time" inside comment_modifiers()
> and sage-doctest_tex doesnot.
> 
> With best regards,
> Lars Fischer

My first thought on reading the above is "get rid of handling .sage files in a special way in order to automatically fix all such issues". That's what I did with .tex files a while ago.

CC: @orlitzky

Component: doctest coverage

Issue created by migration from https://trac.sagemath.org/ticket/1866

@williamstein williamstein added this to the sage-4.8 milestone Jan 20, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Dec 10, 2008

comment:1

I think the issue has been fixed in Sage 3.2.x since we no longer treat .sage files special. Can you verify this?

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title bug in doctesting -- long time not respected in some contexts [probably fixed] bug in doctesting -- long time not respected in some contexts Dec 10, 2008
@orlitzky
Copy link
Contributor

comment:2

This is fixed. A simple test case:

$ cat sage_extension_tests.sage 
r"""

A test case for *.sage files.

::

    sage: 1
    1

::

    sage: 2 # long time
    2

::

    sage: 3
    3

"""

I see that the long test is skipped normally:

$ sage -t -verbose sage_extension_tests.sage
...
5 passed and 0 failed.

And executed when -long is passed:

$ sage -t -verbose -long sage_extension_tests.sage
...
6 passed and 0 failed.

@mwhansen mwhansen removed this from the sage-4.8 milestone Dec 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants