Rev 2477: Clarify TestSkipped in http://sourcefrog.net/bzr/doc
Martin Pool
mbp at sourcefrog.net
Thu May 3 07:13:02 BST 2007
At http://sourcefrog.net/bzr/doc
------------------------------------------------------------
revno: 2477
revision-id: mbp at sourcefrog.net-20070503061300-db7vcrdh10vhhqih
parent: mbp at sourcefrog.net-20070502113316-dshmmkjwwzjsyuq8
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: doc
timestamp: Thu 2007-05-03 16:13:00 +1000
message:
Clarify TestSkipped
modified:
HACKING HACKING-20050805200004-2a5dc975d870f78c
=== modified file 'HACKING'
--- a/HACKING 2007-05-02 11:33:16 +0000
+++ b/HACKING 2007-05-03 06:13:00 +0000
@@ -443,16 +443,17 @@
If a test can't be run, it can say that it's skipped. This is typically
used in parameterized tests - for example if a transport doesn't support
-setting permissions, we'll skip the tests that relating to that. Skipped
-tests are appropriate when there's just no possibility that the test will
-ever run in this situation, and nothing either developers or users can do
-about it. ::
+setting permissions, we'll skip the tests that relating to that. ::
try:
return self.branch_format.initialize(repo.bzrdir)
except errors.UninitializableFormat:
raise tests.TestSkipped('Uninitializable branch format')
+Raising TestSkipped is a good idea when you want to make it clear that the
+test was not run, rather than just returning which makes it look as if it
+was run and passed.
+
A subtly different case is a test that should run, but can't run in the
current environment. This covers tests that can only run in particular
operating systems or locales, or that depend on external libraries. Here
More information about the bazaar-commits
mailing list