Rev 4883: (jam) Some docs about the new ModuleAvailableFeature. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Dec 10 01:30:35 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4883 [merge]
revision-id: pqm at pqm.ubuntu.com-20091210013032-30uu9d8xyqf13514
parent: pqm at pqm.ubuntu.com-20091209180709-vahds276v0vklwad
parent: john at arbash-meinel.com-20091209154537-synrtb4uo89febvf
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-12-10 01:30:32 +0000
message:
(jam) Some docs about the new ModuleAvailableFeature.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
doc/developers/testing.txt testing.txt-20080812140359-i70zzh6v2z7grqex-1
=== modified file 'NEWS'
--- a/NEWS 2009-12-09 17:21:54 +0000
+++ b/NEWS 2009-12-10 01:30:32 +0000
@@ -118,6 +118,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