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

Implement sage -t --time #7493

Closed
nthiery opened this issue Nov 19, 2009 · 6 comments
Closed

Implement sage -t --time #7493

nthiery opened this issue Nov 19, 2009 · 6 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Nov 19, 2009

When a test file takes time to execute, it would be handy to have a quick overview of which specific tests take long.

Something like:

    sage -t --verbose --time bla.py
    Trying: 
        1+1
    Expecting:
        2
    ok [0.1ms]
    Trying: 
        factor(....)
    Expecting:
        ...
    ok [10s] warning: please use # long time
    Trying: 
        factor(.....) # long time
    Expecting:
        ...
    ok [10s]
    Trying: 
        factor(........)
    Expecting:
        ...
    ok [300s] warning: this is too long!

And in non verbose mode:

    sage -t --time bla.py
    Warning: factor(....) line 30 takes 10s: please use # long time
    Warning: factor(........) line 50 takes 300s: this is too long!

Component: doctest coverage

Reviewer: Jeroen Demeyer

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

@nthiery
Copy link
Contributor Author

nthiery commented Jan 20, 2010

comment:1

Here is a patch which sorts of do the job. It is not intended to be merged, but to make you crave enough for the feature to actually implement it right:

zephyr-~s/categories>sage -t -time coxeter_groups.py    
sage -t -time "4.3/devel/sage-combinat/sage/categories/coxeter_groups.py"
...
File "/opt/sage-4.3/devel/sage-combinat/sage/categories/coxeter_groups.py", line 1010:
    sage: for u in P4:
          for v in P4:
              assert u.bruhat_lequal(v) == P4toW(u).bruhat_le(P4toW(v))
Expected nothing
Got:
    Warning: test took 8.1s > 1s. Please use # long time
Total time for all tests: 24.0 seconds

@aghitza
Copy link

aghitza commented Jan 23, 2010

comment:2

Nicolas, can you actually attach your toy patch to this ticket? I've now been in a few situations where I'm staring at the output of sage -t -verbose, and having anything automated for this would be a great help to my sanity.

@nthiery
Copy link
Contributor Author

nthiery commented Jan 23, 2010

Attachment: trac_7493-check-long-time.patch.gz

@nthiery
Copy link
Contributor Author

nthiery commented Jan 23, 2010

comment:3

Replying to @aghitza:

Nicolas, can you actually attach your toy patch to this ticket? I've now been in a few situations where I'm staring at the output of sage -t -verbose, and having anything automated for this would be a great help to my sanity.

Oops, there it is.

Eh eh, maybe my strategy is going to work :-)

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link

comment:4

This is essentially all implemented in #12415.

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