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

Allow reporting of skipped optional tests #13278

Closed
roed314 opened this issue Jul 19, 2012 · 24 comments
Closed

Allow reporting of skipped optional tests #13278

roed314 opened this issue Jul 19, 2012 · 24 comments

Comments

@roed314
Copy link
Contributor

roed314 commented Jul 19, 2012

From a discussion on sage-combinat-devel:

Optionally print extra information after doctesting: how many optional doctests were skipped, and how they were labeled ("skipped 5 doctests marked "optional -- bug").

See also #14276.

Apply attachment: 13278.2.patch

Apply attachment: 13278_script.patch to the script repo

Depends on #12415
Depends on #14331

Component: doctest framework

Author: David Roe

Reviewer: Jeroen Demeyer

Merged: sage-5.9.beta2

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

@roed314
Copy link
Contributor Author

roed314 commented Mar 15, 2013

Author: David Roe

@roed314
Copy link
Contributor Author

roed314 commented Mar 15, 2013

comment:1

It was necessary to do some cleanup in sage.doctest.sources.DocTestSource: now it just stores an options object rather than separate options that it cares about.

There will be some double counting if optional tests are marked with multiple tags.

For ReST files with inner sources we'll also miss the optional tests in the inner sources.

Both issues seem minor enough that they're not worth the extra code complexity.

@roed314
Copy link
Contributor Author

roed314 commented Mar 15, 2013

Attachment: 13278_script.patch.gz

@roed314

This comment has been minimized.

@roed314

This comment has been minimized.

@jdemeyer
Copy link

comment:4

Could you add a test to sage/doctest/test.py to test a complete sage -t --show-skipped run (also checking that optional tests which are run are not reported).

And I would enable --show-skipped automatically when --verbose is given.

@roed314
Copy link
Contributor Author

roed314 commented Mar 16, 2013

Attachment: 13278.patch.gz

@roed314
Copy link
Contributor Author

roed314 commented Mar 16, 2013

comment:5

Replying to @jdemeyer:

Could you add a test to sage/doctest/test.py to test a complete sage -t --show-skipped run (also checking that optional tests which are run are not reported).

And I would enable --show-skipped automatically when --verbose is given.

Done.

@jdemeyer
Copy link

comment:6

Why still use useabspath here (but remove it from the documentation)?

def __init__(self, path, options, useabspath=False)

especially since you replace

if self.useabspath: 

by

if self.options.abspath: 

@jdemeyer
Copy link

comment:7

And why isn't --long displayed in the output here:

sage: subprocess.call(["sage", "-t", "--long", "--show-skipped", "--optional=sage,gap", "show_skipped.rst"], cwd=tests_dir) 
Running doctests ... 
Doctesting 1 file. 
sage -t show_skipped.rst 

@jdemeyer
Copy link

comment:8

Line 405, you could replace

untested = optionals["not tested"] + optionals["not implemented"]

by

untested = optionals.pop("not tested") + optionals.pop("not implemented")

Then you don't need to check for "not tested" or "not implemented" further.

And I think the translation "known bug" -> "bug" should better be moved inside the parse_optional_tags() function itself.

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@roed314

This comment has been minimized.

@roed314
Copy link
Contributor Author

roed314 commented Mar 17, 2013

comment:10

Fixed.

@jdemeyer
Copy link

comment:11

Attachment: 13278_review.patch.gz

**********************************************************************
File "devel/sage/sage/doctest/test.py", line 240, in sage.doctest.test
Failed example:
    subprocess.call(["sage", "-t", "--long", "--show-skipped", "--optional=sage,gap", "show_skipped.rst"], cwd=tests_dir)
Expected:
    Running doctests ...
    Doctesting 1 file.
    sage -t --long show_skipped.rst
        1 unlabeled test not run
        2 tests not run due to known bugs
        1 other test skipped
        [3 tests, ... s]
    ----------------------------------------------------------------------
    All tests passed!
    ----------------------------------------------------------------------
    ...
    0
Got:
    Running doctests with ID 2013-03-27-00-20-38-1d0ae1fc.
    Doctesting 1 file.
    sage -t --long show_skipped.rst
        1 unlabeled test not run
        2 tests not run due to known bugs
        0 not tested tests not run
        1 other test skipped
        [3 tests, 0.0 s]
    ----------------------------------------------------------------------
    All tests passed!
    ----------------------------------------------------------------------
    Total time for all tests: 0.0 seconds
        cpu time: 0.0 seconds
        cumulative wall time: 0.0 seconds
    0
**********************************************************************

I'll have a look.

@jdemeyer
Copy link

Changed dependencies from #12415 to #12415, #14331

@jdemeyer
Copy link

Attachment: 13278_review2.patch.gz

@jdemeyer
Copy link

comment:13

attachment: 13278_review2.patch (which replaces attachment: 13278_review.patch) needs review.

@jdemeyer

This comment has been minimized.

@roed314
Copy link
Contributor Author

roed314 commented Mar 27, 2013

comment:14

Works for me.

@jdemeyer
Copy link

comment:15

This conflicts massively with #14331, rebasing... :-(

@jdemeyer
Copy link

comment:16

Attachment: 13278.2.patch.gz

Rebased and squashed the two patches.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Merged: sage-5.9.beta2

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

2 participants