-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
sage -t --optional='sage,!FEATURE' #33823
Comments
This comment has been minimized.
This comment has been minimized.
Author: Matthias Koeppe |
New commits:
|
Commit: |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
How about respecting |
comment:9
We don't have a mechanism for that, and it does not help for the main use case of this ticket - disabling standard features such as |
comment:10
Yes, you are giving yourself some tools to be able to isolate what you are testing more. Which is interesting in and of itself. But if we completely migrate to pytest (let's be honest that will/would take years), will that feature survive the migration? Does pytest support such disabling? |
comment:11
Replying to @mkoeppe:
It worked for years until you added runtime detection that overrides it. Now you want to add a third layer of complexity without fixing the previous two. I posted one possible solution recently on the mailing list and another ticket. Another (inevitable, eventually) option is to add a |
comment:12
Replying to @orlitzky:
Sage has never had a mechanism to disable the use of optional features by the Sage library. The only thing that has changed is what the doctester tests. The present ticket gives you the tool that you need if you have problems with an optional package in your distribution packaging. |
comment:13
Let's keep the ticket focused. It is not meant as an invitation to continue your musings from sage-devel |
comment:14
Replying to @kiwifb:
Conditionalizing tests on the presence of features is a key idea of the modularization, and we'll make it work with pytest too. Skipping tests based on predicates is a standard feature of all test frameworks. #33546 implements the Sage doctest discovery in pytest. It continues to use code from |
This comment has been minimized.
This comment has been minimized.
comment:17
I think it's a good idea to have a negation possibility here. Maybe the following needs a clarification in the help-string: In a positive list of features you don't need to type BTW: If you have installed some optional feature Further: I really don't know the intention of the log-message
Together with 30 optional doctests, the log-message shows the same result:
This seems to be due to: sage: from sage.doctest.external import AvailableSoftware
sage: S = AvailableSoftware()
sage: S._indices['database_knotinfo']
10
sage: S._seen[10]
0 But this can be changed by performing a sage: 'database_knotinfo' in S
True
sage: S._seen[10]
1 So it looks as if such a test is missing somewhere. |
comment:19
The line This works as designed, but if you have a suggestion how it should be changed, we can change it. |
comment:20
Replying to @soehms:
The doctests marked There is no mechanism to disable the actual feature in the Sage runtime. What |
Reviewer: Sebastian Oehms |
comment:21
Replying to @mkoeppe:
I'm wondering what dynamically means here? From the code I displayed in my previous comment it appears that a feature is dynamically detected if it is tested to be contained in
It's difficult to make a suggestion before I've completely understood the intention. According to the given phrase I assumed it would correspond to the Features to be detected. So, at least in order to resolve that irritation it would be enough to change the phrase into
Perhaps I have in mind a new option |
comment:22
Replying to @soehms:
Sorry for using undefined terminology. When you use When you use Other features, by default those enumerated by |
comment:23
Replying to @mkoeppe:
Thanks for the explanation (I missed the fact that |
comment:24
Replying to @soehms:
Yes, I think something like this could make sense if there's a strong enough use case for it. It would probably be best to provide this mechanism also for non-doctest situations. So this would be a separate ticket. Thanks for reviewing! |
comment:25
Replying to @mkoeppe:
The use case I'm thinking of is the following: If you have installed an optional package
then it might happen that you get
the same invocation of
Of course! After my vacation (that is in a couple of weeks) I will try to figure out how this could be done. |
Changed branch from u/mkoeppe/sage__t___optional__sage__feature_ to |
comment:27
Thanks for this ticket. It will be quite useful for example to test that |
Changed commit from |
comment:28
Replying to @soehms:
see #34185! |
sage -t --optional='sage,!FEATURE'
will disable autodetection ofFEATURE
.Useful for checking sequences of
# optional - FEATURE
annotations in particular whenFEATURE
is standard in Sage, for examplesage.misc.cython
(#33029):Also,
sage -t --optional='sage,optional,!FEATURE'
will remove it from the list of optional features supplied by the package list and disable auto-detection.For example, when the optional SPKG
bliss
is installed,--optional='sage,optional'
would expand to a list includingbliss
. By using--optional='sage,optional,!bliss'
, it can be removed.CC: @kwankyu @orlitzky @kiwifb @seblabbe
Component: refactoring
Author: Matthias Koeppe
Branch:
ba86146
Reviewer: Sebastian Oehms
Issue created by migration from https://trac.sagemath.org/ticket/33823
The text was updated successfully, but these errors were encountered: