On 08/06/2010 04:41 AM, Simon King wrote: > Let s be a string (e.g., a docstring containing tests). Is it possible > to perform the analogue of "sage -t" on s without writing s into a > file and running a sub-process "sage -t" on that file?
We're in the *very* early stages of developing a new doctesting API at http://trac.sagemath.org/sage_trac/ticket/9224 Potential use cases on the command-line or in the notebook: sage: doctest('file.sage', long=True, optional=['axiom', 'magma']) sage: doctest(os.path.join(SAGE_ROOT, 'devel', 'sage', 'sage', 'monoids'), processes=4) sage: stats = {} # Collect errors, counts, timings, etc. sage: doctest('foo.py', 'bar.pyx', stats=stats) sage: def f(): ....: """ ....: sage: f() ....: 1 ....: """ ....: return 1 ....: sage: doctest(f) sage: doctest(f.__doc__) We may start with an abstract Doctester class and try to extend it with implementations that run out-of-process and in-process. Perhaps also a subclass that forks (cf. #9501, #9631)? But this is far from certain right now. There's also a ticket for other new doctesting features: http://trac.sagemath.org/sage_trac/ticket/9225 Comments are welcome! -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org