ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 11 Jul 2018 10:19:16 -0500make ptest fails after compilation based on Python3http://ask.sagemath.org/question/42924/make-ptest-fails-after-compilation-based-on-python3/I installed sagemath 8.3rc0 on my fedora 28 linux x86_64 system using the following commands:
make configure
./configure --prefix=$HOME/sage --with-python=3 --with-mp=gmp
make build
This seemed to have installed sage successfully but when I run tests with:
$ make ptest
I get the following errors and make ptest fails:
[manifolds] from Queue import Queue
[manifolds] ModuleNotFoundError: No module named 'Queue'
OSError: [manifolds] /home/user/sagemath/inst/lib/python3.6/site-packages/sage/manifolds/differentiable/curve.py:docstring of sage.manifolds.differentiable.curve.DifferentiableCurve:58: WARNING: Exception occurred in plotting curve-1
[dochtml] [manifolds] dumping object inventory... done
[dochtml] [manifolds] build succeeded.
[dochtml] [manifolds] The HTML pages are in ../inst/share/doc/sage/inventory/en/reference/manifolds.
[dochtml] Error building the documentation.
Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):
* documentation: dochtml
log file: /home/user/sagemath/src/logs/pkgs/../dochtml.log
The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
make[1]: *** [Makefile:33: all-start] Error 1
make[1]: Leaving directory '/home/user/sagemath/src'
make: *** [Makefile:13: all] Error 2
I believe one of the `OSError` or the `dochtml` error is causing `make ptest` to fail. Can I get advice on how I can correct these problems?number123Wed, 11 Jul 2018 10:19:16 -0500http://ask.sagemath.org/question/42924/How to doctest an exception ?http://ask.sagemath.org/question/39306/how-to-doctest-an-exception/I'd like to doctest an exception, to show that some call is *expected* to fail (and, latter, to show how to cope with that). Something along the lines of:
sage: foo(x)
ValueError
... #Elided
ValueError: x is not palatable to foo
I haven't found any doctest directive allowing me to tell "This test is *expected* to raise an exception" ; so, when I run the doctest, I can't even compare what I get with the text of the expected traceback. The only solution I found so far is to wrap my test in a ```try:... except: ...``` construct, which is not very demonstrative.
Any idea ?Emmanuel CharpentierSat, 28 Oct 2017 06:24:29 -0500http://ask.sagemath.org/question/39306/howto get Sage doctest coverage statisticshttp://ask.sagemath.org/question/7568/howto-get-sage-doctest-coverage-statistics/How can a user get/see recent Sage doctest coverage statistics?
>
Thanks,
Jackjack77Sun, 11 May 2014 22:56:26 -0500http://ask.sagemath.org/question/7568/Running sage --testall in parallelhttp://ask.sagemath.org/question/10865/running-sage-testall-in-parallel/Hello there! After an install of sage from binaries (Fedora20), I ran `sage --testall`. However, it takes quite a lot of time (`3000s`). I have 4 processors and running this in parallel would shorten it significantly (and it should be easily possible to run the tests in parallel).
Therefore my question: **Can I run the tests in parallel? And how?**toheczSun, 29 Dec 2013 04:07:33 -0600http://ask.sagemath.org/question/10865/injecting names into global namespace doesn't work with doctesthttp://ask.sagemath.org/question/10423/injecting-names-into-global-namespace-doesnt-work-with-doctest/Here is a minimal example of the problem I am running into. I have a file "MyClass.py":
class MyClass(object):
def __init__(self,subscript):
self.subscript = subscript
def __repr__(self):
return "MyClass " + str(self.subscript)
def make_MyClass(n):
"""
Creates n MyClass instances and assigns them to to variables A0, ..., A(n-1).
Examples::
sage: make_MyClass(3)
sage: A0
MyClass 0
sage: A2
MyClass 2
sage: A1.subscript
1
"""
for i in range(n):
globals()["A" + str(i)] = MyClass(i)
If I doctest it, I get `NameError: name 'A0' is not defined`, but if I just load the file and type in the commands, it works how I want it to. It must be something about how globals() interacts with doctest.
I know it is possible to make this work, because for example the function var does something like this. I tried looking at the var.pyx source, but it looks like they are doing the same thing as me. (There is a comment about globals() being the reason that it had to be Cython. I tried making the example above a pyx, but that didn't seem to help.)paragonMon, 12 Aug 2013 10:39:10 -0500http://ask.sagemath.org/question/10423/Doctesting a cython filehttp://ask.sagemath.org/question/9601/doctesting-a-cython-file/Bonjour à tous,
I have a cython file stab.pyx, which uses a C file libstab.c, located in the same directory. Everything works fine with:
sage: load stab.pyx
Compiling ./stab.pyx...
and I can use classes, methods and so on defined in my file. It works fine too in notebook, I just need to give the full access path for loading (compiling) this file.
Today I had the strange idea of adding some documentation (wow) and doctests. Again the notebook displays my doc with nice formatting when I use the usual '?'. The problem is that I can't verify doctests with:
sage -t stab.pyx
Sage complains gcc fails because it does'nt find libstab.c. What's a simple way for automatic doctesting this file ?
Amitiés [JB]
BétrémaMon, 03 Dec 2012 08:03:26 -0600http://ask.sagemath.org/question/9601/