# HG changeset patch
# User J. H. Palmieri <palmieri@math.washington.edu>
# Date 1317181527 25200
# Node ID 7d3501b6cad2d65662971c473733dc3a88bbd37e
# Parent  d5f2dfc014530707f8a3744f4867c0073e08c0b9
#11821: doctests and documentation for 'sage --preparse' and 'sage -t'

diff --git a/doc/en/developer/coding_in_python.rst b/doc/en/developer/coding_in_python.rst
--- a/doc/en/developer/coding_in_python.rst
+++ b/doc/en/developer/coding_in_python.rst
@@ -243,14 +243,21 @@
 Consult the file ``preparser.py`` for more details about Sage
 preparsing, more examples involving raw literals, etc.
 
-When a file ``foo.sage`` is loaded in a Sage session, a preparsed
-version of ``foo.sage`` is created and named ``foo.py``. The beginning
-of ``foo.py`` states:
+When a file ``foo.sage`` is loaded or attached in a Sage session, a
+preparsed version of ``foo.sage`` is created. The beginning of the
+preparsed file states:
 
 ::
 
     This file was *autogenerated* from the file foo.sage.
 
+You can explicitly preparse a file with the ``--preparse``
+command-line option: running ::
+
+    sage --preparse foo.sage
+
+creates the file ``foo_sage.py``.
+
 
 The Sage coercion model
 =======================
diff --git a/doc/en/developer/doctesting.rst b/doc/en/developer/doctesting.rst
--- a/doc/en/developer/doctesting.rst
+++ b/doc/en/developer/doctesting.rst
@@ -634,7 +634,7 @@
 and then doctest that::
 
     [mvngu@sage build]$ sage-5.9/sage --preparse my_sage_script.sage
-    [mvngu@sage build]$ cat my_sage_script.py
+    [mvngu@sage build]$ cat my_sage_script_sage.py
     # This file was *autogenerated* from the file my_sage_script.sage.
     from sage.all_cmdline import *   # import sage library
     _sage_const_3 = Integer(3)
@@ -648,10 +648,10 @@
             8
         """
         return n**_sage_const_3
-    [mvngu@sage build]$ sage-5.9/sage -t my_sage_script.py
+    [mvngu@sage build]$ sage-5.9/sage -t my_sage_script_sage.py
     Running doctests with ID 2012-07-07-00-26-46-2bb00911.
     Doctesting 1 file.
-    sage -t my_sage_script.py
+    sage -t my_sage_script_sage.py
         [2 tests, 0.0 s]
     ------------------------------------------------------------------------
     All tests passed!
diff --git a/sage/tests/cmdline.py b/sage/tests/cmdline.py
--- a/sage/tests/cmdline.py
+++ b/sage/tests/cmdline.py
@@ -296,7 +296,7 @@
 
         sage: s = "'''\nThis is a test file.\n'''\ndef my_add(a,b):\n    '''\n    Add a to b.\n\n        EXAMPLES::\n\n            sage: my_add(2,2)\n            4\n        '''\n    return a + b\n"
         sage: script = os.path.join(tmp_dir(), 'my_script.sage')
-        sage: script_py = script[:-5] + '.py'
+        sage: script_py = script[:-5] + '_sage.py'
         sage: F = open(script, 'w')
         sage: F.write(s)
         sage: F.close()
