#18558: Test all installed optional packages by default
-------------------------------------+-------------------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: doctest framework | Resolution:
Keywords: | Merged in:
Authors: Nathann Cohen, | Reviewers: Jeroen Demeyer, Karl-
Jeroen Demeyer | Dieter Crisman
Report Upstream: N/A | Work issues:
Branch: u/jdemeyer/18558 | Commit:
Dependencies: #18456, #18124, | e3f463d32d4d05a55f8cee4315bb01d9c5de2da2
#18559, #18563, #18579, #18581 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jhpalmieri):
Actually, for reasons I really don't understand, my previous code with
`urllib2` gave me a ton of segfaults when doctesting Sage (?!). In fact I
was getting segfaults just from inserting the lines
{{{
import urllib2
urllib2.urlopen('http://sagemath.org/')
}}}
without the line `options.optional.add('internet')`. I must be doing
something wrong, but I don't know what.
Anyway, the following doesn't produce segfaults (taken from
[http://stackoverflow.com/questions/20913411/test-if-an-internet-
connection-is-present-in-python stackoverflow]):
{{{
#!diff
diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index ce846b2..ff365dd 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -256,6 +256,15 @@ class DocTestController(SageObject):
for pkg, versions in optional_pkgs.items():
if versions[0] == versions[1]:
options.optional.add(pkg)
+ # If there is an internet connection, add
+ # 'internet' to the list of optional tags.
+ try:
+ import socket
+ host = socket.gethostbyname('sagemath.org')
+ socket.create_connection((host, 80), 2)
+ options.optional.add('internet')
+ except:
+ pass
# Check that all tags are valid
for o in options.optional:
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18558#comment:131>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.