Merge lp:~lifeless/zope.testing/subunit into lp:zope.testing

Proposed by Robert Collins
Status: Merged
Merge reported by: Benji York
Merged at revision: not available
Proposed branch: lp:~lifeless/zope.testing/subunit
Merge into: lp:zope.testing
Diff against target: 30 lines (+3/-3)
1 file modified
src/zope/testing/testrunner/formatter.py (+3/-3)
To merge this branch: bzr merge lp:~lifeless/zope.testing/subunit
Reviewer Review Type Date Requested Status
Benji York (community) Approve
ZTK steering group Pending
Review via email: mp+26638@code.launchpad.net

Description of the change

Use subunit's extended API more carefully, avoiding passing details
objects into parameters expecting error tuples.

I don't know if tests pass - the getting started instructions just blowup for me, and it didn't look possible to do 'python -m unittest.run zope.testing'.

-Rob

To post a comment you must log in.
Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/zope.testing/subunit into lp:zope.testing.
>
> Requested reviews:
> ZTK steering group (ztk-steering-group)
>
>
> Use subunit's extended API more carefully, avoiding passing details
> objects into parameters expecting error tuples.
>
> I don't know if tests pass - the getting started instructions just
> blowup for me, and it didn't look possible to do 'python -m
> unittest.run zope.testing'.

The "standard" way to run the tests would be via buildout:

 $ /opt/Python-2.6.5/bin/python bootstrap.py
 $ /bin/buildout
 $ bin/test --all

I would actually prefer if the tests became / stayed runnable via the
setuptools 'test' command:

 $ /opt/Python-2.6.5/bin/python setup.py test

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwGx24ACgkQ+gerLs4ltQ4NfgCgvKaifq96pgLATTrX7OD9Admo
FsUAn0P1sNNl/5k/UK5pKbTMN7fftKQR
=PkJm
-----END PGP SIGNATURE-----

Revision history for this message
Robert Collins (lifeless) wrote :

Well, I ran python bootstrap.py and it went boom; at that point I
committed and submitted this proposal ;)

The boom was about accessing some setuptools egg, I think.

Revision history for this message
Benji York (benji) wrote :

I fixed the "python bootstrap.py and it went boom" problem by updating the bootstrap.py.

/me adds a line to the why-I-don't-like-copies-of-bootstrap.py-everywhere list.

Revision history for this message
Benji York (benji) wrote :

The fact that this patch doesn't touch any tests suggests that the subunit output is missing some test cases. I'd like to see some tests that fail without the code changes and pass afterward.

review: Needs Fixing
Revision history for this message
Robert Collins (lifeless) wrote :

I agree there are tests missing; I don't see that holding improvements
of untested code hostage to tests is a good balance.

Revision history for this message
Benji York (benji) wrote :

On Tue, Jul 20, 2010 at 11:15 AM, Robert Collins
<email address hidden> wrote:
> I agree there are tests missing; I don't see that holding improvements
> of untested code hostage to tests is a good balance.

I don't expect the patch to include all the missing tests, but a
regression test would be appropriate. Since you produced the patch, I
assume you can reproduce the behavior that the patch corrects.
--
Benji York

Revision history for this message
Robert Collins (lifeless) wrote :

On Tue, Jul 20, 2010 at 5:31 PM, Benji York <email address hidden> wrote:
> On Tue, Jul 20, 2010 at 11:15 AM, Robert Collins
> <email address hidden> wrote:
>> I agree there are tests missing; I don't see that holding improvements
>> of untested code hostage to tests is a good balance.
>
> I don't expect the patch to include all the missing tests, but a
> regression test would be appropriate.  Since you produced the patch, I
> assume you can reproduce the behavior that the patch corrects.

No, I can't- I just know the API in question.

Revision history for this message
Benji York (benji) wrote :

Well, I'm not happy with the lack of tests, but I suppose that the best thing I can do is merge this as is -- which I did in revision 117583.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/zope/testing/testrunner/formatter.py'
2--- src/zope/testing/testrunner/formatter.py 2010-04-13 09:23:53 +0000
3+++ src/zope/testing/testrunner/formatter.py 2010-06-02 20:44:22 +0000
4@@ -761,7 +761,7 @@
5 test = FakeTest(message)
6 self._subunit.startTest(test)
7 self._emit_tag(tag)
8- self._subunit.addSuccess(test, details)
9+ self._subunit.addSuccess(test, details=details)
10
11 def _emit_error(self, error_id, tag, exc_info):
12 """Emit an error to the subunit stream.
13@@ -1024,7 +1024,7 @@
14 self._subunit.startTest(test)
15 self._emit_tag(self.TAG_GARBAGE)
16 self._subunit.addError(
17- test, self._get_text_details('garbage', unicode(garbage)))
18+ test, details=self._get_text_details('garbage', unicode(garbage)))
19
20 def test_threads(self, test, new_threads):
21 """Report threads left behind by a test.
22@@ -1036,7 +1036,7 @@
23 self._subunit.startTest(test)
24 self._emit_tag(self.TAG_THREADS)
25 self._subunit.addError(
26- test, self._get_text_details('garbage', unicode(new_threads)))
27+ test, details=self._get_text_details('garbage', unicode(new_threads)))
28
29 def refcounts(self, rc, prev):
30 """Report a change in reference counts."""

Subscribers

People subscribed via source and target branches