Hi

On Thu, Sep 10, 2009 at 04:52:48AM -0700, Simon King wrote:
> > >   $ mkdir tst
> > >   $ export SAGE_TESTDIR=`pwd`/tst/
> > >   $ sage -t test.py
> > > where test.py is some Python file in the working directory. It
> > > worked!
> >
> > We did this. It works with a test file doing simple instructions, not
> > with doctests.
> 
> What do you mean by "simple instructions" versus "doctests"?

Uh, in my earlier tests 1+1 worked but examples like below did not.

Even now, with your example:

> If you have a file "test.py" with the following content, what happens
> with "sage -t test.py"?
> def foo(n):
>     """
>     sage: foo(1)
>     2
>     sage: foo(2)
>     3
>     """
>     return 2*n

0 j...@muizenberg:~$vim test.py
0 j...@muizenberg:~$mkdir tst
0 j...@muizenberg:~$mv test.py tst/
0 j...@muizenberg:~$export SAGE_TESTDIR=`pwd`/tst/
0 j...@muizenberg:~$sage -t test.py
ERROR: File ./test.py is missing
exit code: 1
 
----------------------------------------------------------------------
The following tests failed:


        ./test.py
Total time for all tests: 0.0 seconds
0 j...@muizenberg:~$sage -t tst/test.py
ERROR: File ./tst/test.py is missing
exit code: 1
 
----------------------------------------------------------------------
The following tests failed:


        ./tst/test.py
Total time for all tests: 0.0 seconds
0 j...@muizenberg:~$sage -t ~/tst/test.py
sage -t  "/home/jan/tst/test.py"                            
Traceback (most recent call last):
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 754, in <module>
    test_file(argv[1], library_code = library_code)
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 587, in 
test_file
    open(f,"w").write(s)
IOError: [Errno 13] Permission denied: './.doctest_test.py'
         [0.3 s]
exit code: 256
 
----------------------------------------------------------------------
The following tests failed:


        sage -t  "/home/jan/tst/test.py"
Total time for all tests: 0.3 seconds

> I did this on sage.math, after exporting SAGE_TESTDIR to something I
> can write to, and I got the expected doc test error, since of course
> one gets 4, not 3, in the above doc test.

This works for you?? Then I have some other problem.

Jan



-- 
   .~. 
   /V\     Jan Groenewald
  /( )\    www.aims.ac.za
  ^^-^^ 

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to