Sam Skillman  committed f19e770 Merge


  • Participants
  • Parent commits 6d97f85, ef1e561

Comments (0)

Files changed (2)

File doc/manual/source/user_guide/EnzoTestSuite.rst

     Verbose output in the testing sequence.  Very good for tracking down
     specific test failures.
+``--pdb`` default: False
+    When a test fails a pdb session is triggered.  Allows interactive inspection
+    of failed test data.
 **Flags for tests against local reference standards**
 ``--answer-compare-name=str`` default: latest 

File run/

 import nose
 from nose.loader import TestLoader
 from nose.plugins import Plugin
+from nose.plugins import debug
 from nose.plugins.manager import PluginManager
 from yt.config import ytcfg
                       help="Multiply simulation time limit by this factor.")
     parser.add_option("-v", "--verbose", dest='verbose', action="store_true",
                       default=False, help="Slightly more verbose output.")
+    parser.add_option("--pdb", action="store_true", dest="pdb",
+                      default=False, help="Drop into debugger on errors")
     parser.add_option("-b", "--bisect", dest="bisect", action="store_true",
                       default=False, help="Run bisection on test. Requires revisions" +
                       "--good and --bad.  Best if --repo is different from location of"+
     reporting_plugin = ResultsSummary()
     reporting_plugin.enabled = True
+    pdb_plugin = debug.Pdb()
     all_suites = ['quick', 'push', 'full']
     suite_vars = [suite+"suite" for suite in all_suites]
     options, args = parser.parse_args()
+    if options.pdb:
+        pdb_plugin.enabled = True
+        pdb_plugin.enabled_for_failures = True
     # Get information about the current repository, set it as the version in
     # the answer testing plugin.
     options.repository = os.path.expanduser(options.repository)
     if options.bisect:
-    etc = EnzoTestCollection(verbose=options.verbose, args=None,
-                             plugins = [answer_plugin, reporting_plugin])
+    etc = EnzoTestCollection(verbose=options.verbose, args=sys.argv[:1],
+                             plugins = [answer_plugin, reporting_plugin, pdb_plugin])
     construct_selection = {}
     if options.test_suite != unknown: