Commits

Anonymous committed 4ade25b

Updated entry point to use new config arg to TestProgram

  • Participants
  • Parent commits 7efa726

Comments (0)

Files changed (6)

nose2/__init__.py

-from nose2.main import nose2_main
+from nose2.main import main_
 import os
 
-from unittest2 import main_, config, events
+from unittest2.main import TestProgram, USAGE_AS_MAIN
 
 from . import plugins
 
 
-def nose2_main():
-    events.loadPlugins(configLocations=[plugins.configFile()])
-    main_()
+def main_():
+    TestProgram.USAGE = USAGE_AS_MAIN
+    TestProgram(module=None, buffer=True, config=plugins.configFile())

nose2/plugins/plugins.cfg

 [unittest]
 plugins =
         nose2.plugins.attrib
+        nose2.plugins.doctests
         nose2.plugins.outcomes
         nose2.plugins.prof
         nose2.plugins.testid
     version='0.1',
     entry_points= {
         'console_scripts': [
-            'nose2 = nose2:nose2_main',
+            'nose2 = nose2:main_',
             ],
         }
 )

support/pkg1/test/test_things.py

         raise TypeError("oops")
 
     def test_failed(self):
+        print "Hello stdout"
         assert False, "I failed"
 
     def test_skippy(self):

support/unittest.cfg

+[outcomes]
+treat-as-skip =
+    IOError
+    TodoError
+    TypeError
+treat-as-fail =
+    GlormpError