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

Make "sage -t -all" more robust, in particular when SAGE_SRC is SAGE_LIB #31352

Closed
mkoeppe opened this issue Feb 7, 2021 · 5 comments
Closed

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Feb 7, 2021

Observed on conda:

$ sage -t --all
too many failed tests, not using stored timings
Running doctests with ID 2021-02-06-16-05-28-bc4dacc2.
Using --optional=dochtml,pip,sage
Doctesting entire Sage library.
Traceback (most recent call last):
  File "/Users/mkoeppe/miniconda3/envs/sage/bin/sage-runtests", line 182, in <module>
    err = DC.run()
  File "/Users/mkoeppe/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/control.py", line 1234, in run
    self.expand_files_into_sources()
  File "/Users/mkoeppe/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/control.py", line 817, in expand_files_into_sources
    self.sources = [FileDocTestSource(path, self.options) for path in expand()]
  File "/Users/mkoeppe/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/control.py", line 817, in <listcomp>
    self.sources = [FileDocTestSource(path, self.options) for path in expand()]
  File "/Users/mkoeppe/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/sources.py", line 528, in __init__
    raise ValueError("unknown file extension %r"%ext)
ValueError: unknown file extension ''

Instead of showing an error, it should just warn about files that it cannot handle (and show their filenames so that it becomes clear what the problem is)

Depends on #32813

CC: @isuruf @jhpalmieri @fchapoton @seblabbe

Component: doctest framework

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Feb 7, 2021
@mkoeppe

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:2

I think the relevant line is https://github.com/sagemath/sagetrac-mirror/blob/develop/src/sage/doctest/sources.py?h=9.3.beta7#n527. Changing this to a print statement might be good enough, and this worked in a simple test, but I'm not sure. I would feel more comfortable if, when an invalid file extension pops up, we explicitly tell the doctester to not test it, but maybe the other parts of the __init__ method take care of that somehow.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Apr 15, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 2, 2021

comment:5

Related: #32813

@seblabbe
Copy link
Contributor

seblabbe commented Nov 3, 2021

comment:6

I did one more commit in #32813 to also show the filename in the error message and not only the wrong extension. So it should cover the goal of this ticket too.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 23, 2022

Dependencies: #32813

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