Skip to content

Commit ef73c85

Browse files
Matthias Koeppetornaria
authored andcommitted
Don't test features to implement --hide=all
Previously, using `--hide=all` or `--hide=optional` would result in features being tested, including external ones, in particular internet. Those are not supposed to be tested, for instance when running `--optional=all` they won't be tested. The current commit makes unnecessary to test any feature for implementing the `--hide` option.
1 parent 5a755e9 commit ef73c85

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/sage/doctest/control.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,18 +1502,14 @@ def run(self):
15021502
available_software._allow_external = self.options.optional is True or 'external' in self.options.optional
15031503

15041504
for h in self.options.hide:
1505-
try:
1505+
if h in available_software:
15061506
i = available_software._indices[h]
1507-
except KeyError:
1508-
pass
1509-
else:
15101507
f = available_software._features[i]
1511-
if f.is_present():
1512-
f.hide()
1513-
self.options.hidden_features.add(f)
1514-
for g in f.joined_features():
1515-
if g.name in self.options.optional:
1516-
self.options.optional.discard(g.name)
1508+
f.hide()
1509+
self.options.hidden_features.add(f)
1510+
for g in f.joined_features():
1511+
if g.name in self.options.optional:
1512+
self.options.optional.discard(g.name)
15171513

15181514
for o in self.options.disabled_optional:
15191515
try:

0 commit comments

Comments
 (0)