Rev 4877: Add a NEWS entry and an entry in the testing docs about ModuleAvailableFeature in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-test-imports
John Arbash Meinel
john at arbash-meinel.com
Wed Dec 9 15:45:41 GMT 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-test-imports
------------------------------------------------------------
revno: 4877
revision-id: john at arbash-meinel.com-20091209154537-synrtb4uo89febvf
parent: john at arbash-meinel.com-20091208214607-c5gbkx533wr3eg84
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-win32-test-imports
timestamp: Wed 2009-12-09 09:45:37 -0600
message:
Add a NEWS entry and an entry in the testing docs about ModuleAvailableFeature
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2009-12-07 22:32:56 +0000
+++ b/NEWS 2009-12-09 15:45:37 +0000
@@ -116,6 +116,11 @@
Internals
*********
+* New test Feature: ``ModuleAvailableFeature``. It is designed to make it
+ easier to handle what tests you want to run based on what modules can be
+ imported. (Rather than lots of custom-implemented features that were
+ basically copy-and-pasted.) (John Arbash Meinel)
+
* Several code paths that were calling ``Transport.get().read()`` have
been changed to the equalivent ``Transport.get_bytes()``. The main
difference is that the latter will explicitly call ``file.close()``,
=== modified file 'doc/developers/testing.txt'
--- a/doc/developers/testing.txt 2009-12-02 20:34:07 +0000
+++ b/doc/developers/testing.txt 2009-12-09 15:45:37 +0000
@@ -353,6 +353,21 @@
KnownFailure should be used with care as we don't want a
proliferation of quietly broken tests.
+ModuleAvailableFeature
+ A helper for handling running tests based on whether a python
+ module is available. This can handle 3rd-party dependencies (is
+ ``paramiko`` available?) as well as stdlib (``termios``) or
+ extension modules (``bzrlib._groupcompress_pyx``). You create a
+ new feature instance with::
+
+ MyModuleFeature = ModuleAvailableFeature('bzrlib.something')
+
+ ...
+ def test_something(self):
+ self.requireFeature(MyModuleFeature)
+ something = MyModuleFeature.module
+
+
We plan to support three modes for running the test suite to control the
interpretation of these results. Strict mode is for use in situations
like merges to the mainline and releases where we want to make sure that
More information about the bazaar-commits
mailing list