Merge lp:~jelmer/brz/no-plugin-no-test into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/no-plugin-no-test
Merge into: lp:brz
Diff against target: 14 lines (+3/-1)
1 file modified
breezy/tests/test_features.py (+3/-1)
To merge this branch: bzr merge lp:~jelmer/brz/no-plugin-no-test
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+325885@code.launchpad.net

Commit message

Don't run PluginLoadedFeature positive test when there are no plugins loaded.

Description of the change

Don't run PluginLoadedFeature positive test when there are no plugins loaded.

Otherwise, the test failures with an IndexError.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

One thing to fix, see inline comment.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/test_features.py'
2--- breezy/tests/test_features.py 2017-06-17 12:23:19 +0000
3+++ breezy/tests/test_features.py 2017-06-17 14:28:41 +0000
4@@ -132,7 +132,9 @@
5 class TestPluginLoadedFeature(tests.TestCase):
6
7 def test_available_plugin(self):
8- a_plugin_name = breezy.global_state.plugins.keys()[0]
9+ if not breezy.global_state.plugins:
10+ self.skipTest('no plugins available to test with')
11+ a_plugin_name = next(iter(breezy.global_state.plugins))
12 feature = features.PluginLoadedFeature(a_plugin_name)
13 self.assertEqual(a_plugin_name, feature.plugin_name)
14 self.assertEqual(a_plugin_name + ' plugin', str(feature))

Subscribers

People subscribed via source and target branches