Changeset 53

Show
Ignore:
Timestamp:
Mon May 29 20:48:49 2006
Author:
jpellerin
Message:

r1390@Jason-Pellerins-Computer: jhp | 2006-05-29 20:41:29 -0500
Correct handling of trailing comma in attrib plugin args. Thanks Titus Brown for the patch.
r1391@Jason-Pellerins-Computer: jhp | 2006-05-29 20:48:45 -0500
Restore sys.stdout after run() in nose.core. Thanks to Titus Brown for the bug report.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • branches/0.9-stable/unit_tests/test_plugins.py

    r47 r53  
    68 68             nose.plugins.pkg_resources = tmp  
    69 69             logging.getLogger('nose.plugins').setLevel(lvl)  
      70              
    70 71     def test_add_options(self):  
    71 72         conf = Config()  
     
    231 232                                         [('weird', '66')]])  
    232 233  
      234         # don't die on trailing ,  
      235         opt.attr = [ 'something,' ]  
      236         plug.configure(opt, Config())  
      237         self.assertEqual(plug.attribs, [[('something', True)]] )  
      238          
    233 239         if compat_24:  
    234 240             opt.attr = None  
  • branches/0.9-stable/unit_tests/test_core.py

    r40 r53  
    26 26         assert '__main__' in t.conf.tests  
    27 27  
      28  
      29 class TestAPI_run(unittest.TestCase):  
      30  
      31     def test_restore_stdout(self):  
      32         import sys  
      33         s = StringIO()  
      34         stdout = sys.stdout  
      35         res = nose.core.run(defaultTest=nullcollector, argv=[], env={},  
      36                             stream=s)  
      37         stdout_after = sys.stdout  
      38         self.assertEqual(stdout, stdout_after)  
      39          
    28 40 if __name__ == '__main__':  
    29 41     unittest.main()  
  • branches/0.9-stable/nose/core.py

    r40 r53  
    422 422     """Collect and run test, returning success or failure  
    423 423     """  
    424       return TestProgram(*arg, **kw).success  
      424     result = TestProgram(*arg, **kw).success  
      425     end_capture()  
      426     return result  
    425 427              
    426 428 if __name__ == '__main__':  
  • branches/0.9-stable/nose/plugins/attrib.py

    r47 r53  
    101 101                     # don't die on trailing comma  
    102 102                     if not attrib:  
    103                           pass  
      103                         continue  
    103 103                     items = attrib.split("=", 1)  
    104 104                     if len(items) > 1: