Devin Jeanpierre  committed 0b5fde8

Halting process of actually coding up -i -- I think the reporter needs to be inverted first

  • Participants
  • Parent commits e3ae419
  • Branches interactive-mode

Comments (0)

Files changed (3)

File doctest2/

 import argparse
 from . import *
+from . import interactive
 def _test(testfiles, verbose):
     if not testfiles:
     parser.add_argument('-v', '--verbose', dest='verbose', action='store_const',
                        const=True, default=verbosity,
                        help='enable verbose output')
+    ##parser.add_argument('-i', '--interactive', dest='verbose', action='store_const',
+                       ##const=True, default=False,
+                       ##help='enable interactive failure resolution')
     parser.add_argument('files', metavar='FILE', type=str, nargs='*',
                        help='a file to be tested')

File doctest2/tests/

 def test_extra_tests():
     """Run the supplementary tests to doctest2 that don't apply to doctest"""
-    from doctest2.tests import test_doctest2_shell, test_doctest_additions
+    from doctest2.tests import test_doctest2_shell, test_doctest_additions, test_interactive
     run_doctest(test_doctest2_shell, verbosity=True)
     run_doctest(test_doctest_additions, verbosity=True)
+    run_doctest(test_interactive, verbosity=True)
 def test_stdlib_tests():
     """Run the doctest strings copied from the stdlib"""

File doctest2/tests/

             interactive.unsafe_get_edited_text("failure", self.editor_command),
+class IntegrationDocTests:
+    r"""
+    Test this feature in doctest2-the-program, rather than just unit testing.
+    It is great that we get shell tests now. :)
+    The M.O. of this will be to substitute in a python snippet instead 
+    of $EDITOR.
+    (P.S. these tests are disabled for now)
+        #$ printf ">>> None\nfalse data\n" > bad.doctest
+        #$ printf ">>> None\n\n" > good.doctest
+        #$ python3 -m doctest2 -i bad.doctest EDITOR='python -c "import sys; open(sys.argv[1], \"w\")"'
+        #$ diff bad.doctest good.doctest
+    """
 if __name__ == '__main__':