You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and run sage -t --optional=xx a.py, the doc test is still run.
The problem is there are multiple places that populate the list…
First in doctest/control
# We replace the 'optional' tag by all optional
# packages for which the installed version matches the
# latest available version (this implies in particular
# that the package is actually installed).
if 'optional' in options.optional:
options.optional.discard('optional')
from sage.misc.package import list_packages
for pkg in list_packages('optional', local=True).values():
if pkg.name in options.hide:
continue
# Skip features for which we have a more specific runtime feature test.
if pkg.name in ['bliss', 'coxeter3', 'mcqd', 'meataxe', 'sirocco', 'tdlib']:
continue
if pkg.is_installed() and pkg.installed_version == pkg.remote_version:
options.optional.add(pkg.name)
Second in doctest/parsing
for tag in optional_tags:
if tag not in self.optional_tags:
if tag.startswith('!'):
if tag[1:] in available_software:
extra.add(tag)
elif tag not in available_software:
extra.add(tag)
In this case the xx is put in options.optional by the first block, then it goes to self.optional_tags, which triggers the check, but tag[1:] in available_software returns False. Here extra is the list of "extra conditions" for the doctest to be run.
The text was updated successfully, but these errors were encountered:
Assume you have a doc test of the form
and run
sage -t --optional=xx a.py
, the doc test is still run.The problem is there are multiple places that populate the list…
First in
doctest/control
Second in
doctest/parsing
In this case the
xx
is put inoptions.optional
by the first block, then it goes toself.optional_tags
, which triggers the check, buttag[1:] in available_software
returns False. Hereextra
is the list of "extra conditions" for the doctest to be run.The text was updated successfully, but these errors were encountered: