[MERGE][BUG 315737] Fix failing test when CompiledChunksToLines is not available.

John Arbash Meinel john at arbash-meinel.com
Sun Jan 11 15:32:10 GMT 2009


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


...
> 
>     aaron> If it's checking that chunks_to_lines is compiled, why
>     aaron> doesn't it just
>     aaron> requireFeature(CompiledChunksToLinesFeature)?
> 
> It can't use requireFeature because it wants to test that the
> feature works whether the extension is compiled or not.
> 
> Which is still odd... I'll rename it test_osutils_binding before merging,
> considering that the intent of:
> 
>         if test__chunks_to_lines.CompiledChunksToLinesFeature.available():
>             from bzrlib._chunks_to_lines_pyx import chunks_to_lines
>         else:
>             from bzrlib._chunks_to_lines_py import chunks_to_lines
>         self.assertIs(chunks_to_lines, osutils.chunks_to_lines)
> 
> is to ensure that the correct function is bound inside osutils.
> 
> John, do you agree with that ?
> 
>       Vincent
> 

So, the important part is that when the extension is available, it
should be used. It seemed reasonable to also ensure that we know the
fallback is also available when the extension is not available. Not
enough to merit a full test on its own, but there didn't seem to be a
strong need to just skip the test either.

I've used the pattern before, and would plan on continuing to use it,
unless someone feels it is a bad pattern.

So yeah, I'm fine with your change Vincent.

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

iEYEARECAAYFAklqEPoACgkQJdeBCYSNAAP4+ACePxIrCMFihR+6eopbXt+5b34X
/a0An3Y8Iz5p+3cLjczsCcWw5e9mnuht
=Stnj
-----END PGP SIGNATURE-----



More information about the bazaar mailing list