On Thu, Aug 30, 2018 at 11:04 AM Jeroen Demeyer <j.deme...@ugent.be> wrote: > > At #26110 we noticed that the --optional option for doctests is really > strange when you don't specify "sage" as one of the optional packages. > > Here is how things currently work: any doctest line which doesn't > contain any other tag (like "# optional - mypkg" or even "# long time") > is treated as if it had "# optional - sage". In other words: if you run > doctests with --optional=mypkg (without "sage"), then you are running > only tests containing "# optional - mypkg". If you use "--long > --optional=mypkg", then you run all "# long time" tests and all "# > optional - mypkg" tests. > > Needless to say, this is useless: tests almost never pass when run this > way. The implementation looks deliberately designed, so strictly > speaking it's not a bug. Still, I think that it's something that we > should change.
I have observed this as well, and it's very annoying. I haven't given it much thought though. > I can see two solutions: > > 1. Get rid of "--optional=sage" completely. An added bonus is that this > would slightly simplify the doctest framework. > > 2. Interpret all "sage:" prompts (as opposed to ">>>" prompts) as > implying "# optional - sage". This means that a line like > > sage: do_something() # optional - mypkg > > would only be run under --optional=sage,mypkg but a line like > > >>> do_something() # optional - mypkg > > would be run with --optional=mypkg Although more complicated, I kind of like this solution. From a long-term perspective I think it would be good to make Sage's doctest framework into a separate package that can be more easily used by other projects (especially Sage-affiliated projects). That is admittedly a longer-term goal though, for which I have no immediate plans. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.