Ticket #9054: trac_9054_undo_unittest.patch

File trac_9054_undo_unittest.patch, 1.5 KB (added by saraedum, 6 years ago)

revert changes to misc.unittest introduced by the review patch

  • sage/misc/sage_unittest.py

    exporting patch:
    # HG changeset patch
    # User Julian Rueth <julian.rueth@gmail.com>
    Trac 9054: undo changes to misc.unittest
    
    diff --git b/sage/misc/sage_unittest.py a/sage/misc/sage_unittest.py
    index f611802..1113f66 100644
    b a Unit testing for Sage objects 
    1313import unittest
    1414import sys
    1515import traceback
    16 import misc
    1716
    1817class TestSuite(object):
    1918    """
    class TestSuite(object): 
    255254        In conjonction with ``%pdb on``, this allows for the debbuger
    256255        to jump directly to the first failure location.
    257256        """
    258         time = options.get('cputime')
    259257        if type(skip) == str:
    260258            skip = [skip]
    261259        else:
    class TestSuite(object): 
    272270                # TODO: improve pretty printing
    273271                # could use the doc string of the test method?
    274272                tester.info(tester._prefix+"running .%s() . . ."%method_name, newline = False)
    275                 if time:
    276                     start_time = misc.cputime()
    277273                test_method = getattr(self._instance, method_name)
    278274                try:
    279275                    test_method(tester = tester)
    280                     tester.info(" pass", newline = not time)
    281                     if time:
    282                         tester.info(", cputime: %f"%misc.cputime(start_time))
     276                    tester.info(" pass")
    283277                except catch_exception as e:
    284278                    failed.append(method_name)
    285279                    if isinstance(e, TestSuiteFailure):