Merge lp://staging/~jml/zope.testing/subunit-output-formatter into lp://staging/~vcs-imports/zope.testing/trunk
Proposed by
Jonathan Lange
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Jonathan Lange | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp://staging/~jml/zope.testing/subunit-output-formatter | ||||
Merge into: | lp://staging/~vcs-imports/zope.testing/trunk | ||||
Diff against target: |
1378 lines (+1270/-5) 8 files modified
.bzrignore (+6/-0) src/zope/testing/testrunner/formatter.py (+405/-0) src/zope/testing/testrunner/options.py (+24/-2) src/zope/testing/testrunner/testrunner-leaks.txt (+3/-3) src/zope/testing/testrunner/testrunner-subunit-err.txt (+20/-0) src/zope/testing/testrunner/testrunner-subunit-leaks.txt (+107/-0) src/zope/testing/testrunner/testrunner-subunit.txt (+678/-0) src/zope/testing/testrunner/tests.py (+27/-0) |
||||
To merge this branch: | bzr merge lp://staging/~jml/zope.testing/subunit-output-formatter | ||||
Related bugs: |
|
Commit message
Add a subunit output formatter to zope.testing.
To post a comment you must log in.
Broad issues:
content and content_type are testtools modules; don't import from subunit, it only has them for compatibility glue.
Perhaps tag tests in layer foo with zope:layer:foo, not zope:testing:foo. In fact it looks like they are, and its simply a docstring bug to claim otherwise.
As subunit has a progress abstraction, the 'cannot support progress' statement confused me. Perhaps say 'cannot support zopes concept of progress because xxx'.
I see you've worked around the bug in subunit where there isn't a tag method on the test result; perhaps you could submit a patch for that ? the contract is(I think) clear, just 'not done'.
194 + Since subunit is a stream protocol format, it has no summary.
perhaps 'no need for a summary - when the stream is displayed a summary can be created then.
What is this?
+ def import_errors(self, import_errors):
221 + """Report test-module import errors (if any)."""
222 + # FIXME: Implement this.
... there is code here
235 + def _exc_info_ to_details( self, exc_info): content_ type.ContentTyp e( 'python' , charset='utf8')) (None) format_ traceback( exc_info) content. Content( encode( 'utf8') ])}
236 + """Translate 'exc_info' into a details dictionary usable with subunit.
237 + """
238 + import subunit
239 + content_type = subunit.
240 + 'text', 'x-traceback', dict(language=
241 + formatter = OutputFormatter
242 + traceback = formatter.
243 + return {
244 + 'traceback': subunit.
245 + content_type, lambda: [traceback.
This might be better as t(exc_info, test)
import testtools.content
test = unittest.TestCase()
content = TracebackConten
return {'traceback': content}
unless the formatter. format_ traceback( exc_info) is doing something nonobvious (and if it is, perhaps you should mention that. If its doing something nonobvious, then I suggest subclassing testtools. content. Content similarly to testtools. content. TracebackConten t.
Also, you might want a global import rather than a scope local.
270 + # XXX: Since the subunit stream is designed for machine reading, we content_ type.ContentTyp e( content. Content( stats.stats) .encode( 'utf8') ])}
271 + # should really dump the binary profiler stats here. Sadly, the
272 + # "content" API doesn't support this yet. Instead, we dump the
273 + # stringified version of the stats dict, which is functionally the
274 + # same thing. -- jml, 2010-02-14.
275 + plain_text = subunit.
276 + 'text', 'plain', {'charset': 'utf8'})
277 + details = {
278 + 'profiler-stats': subunit.
279 + plain_text, lambda: [unicode(
meta: where some dependency is insufficient, it might be nice to file a bug saying 'please provide X', and then reference the bug in this patch. That way, when your later self returns, they have something to prompt the memory. octet-stream in http:// www.rfc- editor. org/rfc/ rfc2046. txt for details) content_ type.ContentTyp e('application' , 'octet-stream', {'type' :'cProfile' }) content. Content( cprofile_ type, lambda: [bpickle(stats)])
That said, I'm not sure what subunit is missing here:
(see application/
cprofile_type = testtools.
content = testtools.
return {'profiler-stats': content}
You can also make the content types attributes on self to avoid calculating them every time; they are 'Value Objec...