← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cristiangsp/launchpad:linting-f811 into launchpad:master

 

Cristian Gonzalez has proposed merging ~cristiangsp/launchpad:linting-f811 into launchpad:master.

Commit message:
Fixing F811 linting errors

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cristiangsp/launchpad/+git/launchpad/+merge/406647

Fixing F811 linting errors
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cristiangsp/launchpad:linting-f811 into launchpad:master.
diff --git a/lib/devscripts/tests/test_sourcecode.py b/lib/devscripts/tests/test_sourcecode.py
index 6b538c7..75f2ae4 100644
--- a/lib/devscripts/tests/test_sourcecode.py
+++ b/lib/devscripts/tests/test_sourcecode.py
@@ -112,7 +112,7 @@ class TestInterpretConfiguration(unittest.TestCase):
         config = interpret_config([['key', 'value;revno=45']], False)
         self.assertEqual({'key': ('value', '45', False)}, config)
 
-    def test_key_value_revision(self):
+    def test_key_value_revision_without_third_value_raises_error(self):
         # A (key, value) pair without a third optional value when the
         # value has multiple suffixes of ``;revno=[REVISION]`` raises an
         # error.
diff --git a/lib/lp/bugs/scripts/debbugs.py b/lib/lp/bugs/scripts/debbugs.py
index a15a73b..81055c1 100644
--- a/lib/lp/bugs/scripts/debbugs.py
+++ b/lib/lp/bugs/scripts/debbugs.py
@@ -271,8 +271,6 @@ class Database:
         return bug
 
 if __name__ == '__main__':
-    import sys
-
     for bug in Database('/srv/debzilla.no-name-yet.com/debbugs'):
         try:
             print(bug, bug.subject)
diff --git a/lib/lp/services/features/testing.py b/lib/lp/services/features/testing.py
index e4ed8be..576322f 100644
--- a/lib/lp/services/features/testing.py
+++ b/lib/lp/services/features/testing.py
@@ -67,12 +67,13 @@ class FeatureFixtureMixin:
 
         original_controller = get_relevant_feature_controller()
 
-        def scope_lookup(scope_name):
-            request = get_current_browser_request()
-            return ScopesFromRequest(request).lookup(scope_name)
-
         if self.override_scope_lookup:
             scope_lookup = self.override_scope_lookup
+        else:
+            def scope_lookup(scope_name):
+                request = get_current_browser_request()
+                return ScopesFromRequest(request).lookup(scope_name)
+
         install_feature_controller(
             FeatureController(scope_lookup, rule_source))
         self.addCleanup(install_feature_controller, original_controller)