[MERGE][bug #125784] Don't suppress original errors when .unlock() fails

John Arbash Meinel john at arbash-meinel.com
Tue Jun 17 17:19:34 BST 2008


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

Vincent Ladeuil wrote:
|>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:
|
| <snip/>
|
|     >> def load_tests(standard_tests, module, loader):
|     >> """Parameterize the test for tempfile creation with different
|     >> encodings."""
|     >> to_adapt, result = split_suite_by_re(standard_tests,
|     >> "test__create_temp_file_with_commit_template_in_unicode_dir")
|     >> for test in iter_suite_tests(to_adapt):
|     >> result.addTests(EncodingTestAdapter().adapt(test))
|     >> return result
|     >>
|     >> Thats an example of multiplying a *single* test in a test class.
|     >>
|     >> I don't think it really gets much simpler - I consider this an example
|     >> of well done adaption (except that the scenario and adapter are mixed
|     >> here - but the rest is about ideal).
|     >>
|     >> Rob
|
|     john> That doesn't address writing the adapter, and all of
|     john> the helper code involved in that. (You have
|     john> "EncodingTestAdapter" secretly brought into the
|     john> situation.)
|
| I think the point is that EncodingTestAdapter is only a dict. The
| only defined function could be avoided by inheriting from
| TestScenarioApplier.
|
|         Vincent
|

Dicts don't have a ".adapt()" member. And if I look at EncodingTestAdapter it
has quite a bit of code in .adapt().

Still a lot more work than:

class TestThisWithThisSpecialty(tests.TestClass, TestMixin):

~  _parameter = 'foo'


Which is what... 5 lines if you include whitespace?

I'm just trying to point out that .adapt is non-trivial. Even the above is a lot
more mental effort than a simple subclass.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhX5BYACgkQJdeBCYSNAAPZHQCdEu0kB493/wTjmNdcdoDxV7UH
+b8AoJc+oZ2+AU3SKh2aAqfwG2dfjmeV
=JPrL
-----END PGP SIGNATURE-----



More information about the bazaar mailing list