Fri Mar 31 22:37:47 2006

Ticket #32 (Closed: fixed)

revise setuptools support, phase 1


Priority: normal Reporter: jpellerin
Severity: normal Assigned to: jpellerin
Component: nose Status: closed
Version: 0.9 Resolution: fixed
Milestone: 0.9a1 Keywords:  

Description by jpellerin:

To support setuptools test command as best as possible without monkeypatching, follow PJE's prescription:

   class ResultProxy:
        def addError(self, test, err):
            # reformat err, adding captured info
            # then calling addError() on the wrapped result

        def startTest(self, test):
            # code to begin output capture and assertion tracking
            # then call startTest() on the wrapped result

        def stopTest(self, test):
            # code to end output capture and assertion tracking
            # then call stopTest() on the wrapped result

        # ... etc.


    class TestProxy:
        def __call__(self, result):
            self.wrapped_test(ResultProxy(result))

        def shortDescription(self):
            return self.wrapped_test.shortDescription()

The test_suite hook is still better than the test_loader hook, since test suite can be a function that does other setup; it should configure the system with a setting that deactivates any plugins that can't be supported under this scenario (that is, any plugin that uses report, finalize, prepareTest or setOutputStream)

Changelog

Wed Apr 5 18:15:58 2006: Modified by jpellerin

  • milestone changed from 0.9 to 0.9a1
  • status changed from new to assigned

Sat Apr 8 21:49:16 2006: Modified by jpellerin

  • description changed.

Mon Apr 10 21:51:55 2006: Modified by jpellerin

  • resolution set to fixed
  • status changed from assigned to closed

Added in [21]