Rev 5875: (vila) Add an helper for per_workingtree scenarios that plugins can reuse in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Tue May 17 00:11:51 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5875 [merge]
revision-id: pqm at pqm.ubuntu.com-20110517001147-1rxbyu7x5sr2q1fz
parent: pqm at pqm.ubuntu.com-20110516231929-aenh18a18r12mvp2
parent: v.ladeuil+lp at free.fr-20110516152336-g17j08c7sku00oh5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2011-05-17 00:11:47 +0000
message:
(vila) Add an helper for per_workingtree scenarios that plugins can reuse
(Vincent Ladeuil)
modified:
bzrlib/tests/per_workingtree/__init__.py __init__.py-20060203003124-b2aa5aca21a8bfad
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/tests/per_workingtree/__init__.py'
--- a/bzrlib/tests/per_workingtree/__init__.py 2011-05-04 11:15:37 +0000
+++ b/bzrlib/tests/per_workingtree/__init__.py 2011-05-16 15:23:36 +0000
@@ -50,6 +50,22 @@
}
+def wt_scenarios():
+ """Returns the scenarios for all registered working trees.
+
+ This can used by plugins that want to define tests against these working
+ trees.
+ """
+ scenarios = make_scenarios(
+ tests.default_transport,
+ # None here will cause a readonly decorator to be created
+ # by the TestCaseWithTransport.get_readonly_transport method.
+ None,
+ workingtree.format_registry._get_all()
+ )
+ return scenarios
+
+
class TestCaseWithWorkingTree(per_controldir.TestCaseWithControlDir):
def make_branch_and_tree(self, relpath, format=None):
@@ -114,15 +130,16 @@
'bzrlib.tests.per_workingtree.test_' + name for
name in test_names]
- scenarios = make_scenarios(
- tests.default_transport,
- # None here will cause a readonly decorator to be created
- # by the TestCaseWithTransport.get_readonly_transport method.
- None,
- workingtree.format_registry._get_all()
- )
+ scenarios = wt_scenarios()
# add the tests for the sub modules
return tests.multiply_tests(
loader.loadTestsFromModuleNames(test_workingtree_implementations),
scenarios, standard_tests)
+
+
+class TestWtScenarios(tests.TestCase):
+
+ def test_protect_wt_scenarios(self):
+ # Just make sure we don't accidentally delete the helper again
+ scenarios = wt_scenarios()
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-05-16 19:04:06 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-05-17 00:11:47 +0000
@@ -131,6 +131,9 @@
suite. This can include new facilities for writing tests, fixes to
spurious test failures and changes to the way things should be tested.
+* Make it easier for plugins to reuse the per_workingtree scenarios by
+ restoring the wt_scenarios helper that was accidentally deleted.
+ (Vincent Ladeuil, #783472)
bzr 2.4b2
#########
More information about the bazaar-commits
mailing list