[MERGE] readdir, take 2.
Martin Pool
mbp at canonical.com
Tue Sep 2 05:28:48 BST 2008
Martin Pool has voted resubmit.
Status is now: Resubmit
Comment:
My comments about the docstring and copyright still apply, since they
crossed with this in the post.
I really think you should define this to actually return the list in
order. Then you can test that it actually does so, and the
sorting/stripping won't be pushed into every place that uses it. Other
code that wants to avoid the overhead of sorting will need more pyrex,
but can also avoid the wrapping/unwrapping, which may(?) be comparably
expensive.
+def load_tests(standard_tests, module, loader):
+ """Parameterize readdir tests."""
+ to_adapt, result = split_suite_by_re(standard_tests, "readdir")
+ adapter = TestScenarioApplier()
+ from bzrlib import _readdir_py
+ adapter.scenarios = [('python', {'read_dir':
_readdir_py.read_dir})]
+ try:
+ from bzrlib import _readdir_pyx
+ adapter.scenarios.append(
+ (('pyrex', {'read_dir': _readdir_pyx.read_dir})))
+ except ImportError:
+ pass
+ adapt_tests(to_adapt, adapter, result)
+ return result
+
+
I'm not sure what the other pyrex tests do, but this definitely seems
like a case where we should be indicating that some tests were not run.
For details, see:
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C1220324643.19324.40.camel%40lifeless-64%3E
Project: Bazaar
More information about the bazaar
mailing list