Skip to content

Commit 532d223

Browse files
committed
fix flakes errors
1 parent 7fe9ec8 commit 532d223

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pluggy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class HookimplMarker:
118118
You can instantiate with a project_name to get a decorator.
119119
Calling PluginManager.register later will discover all marked functions
120120
if the PluginManager uses the same project_name.
121-
122121
"""
123122
def __init__(self, project_name):
124123
self.project_name = project_name
@@ -414,7 +413,7 @@ def parse_hookimpl_opts(self, plugin, name):
414413
# false positive
415414
res = None
416415
elif res is None and self._implprefix and name.startswith(self._implprefix):
417-
res = {}
416+
res = {}
418417
return res
419418

420419
def parse_hookspec_opts(self, module_or_class, name):

test_pluggy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ def he_method1(self):
535535

536536
def test_prefix_hookimpl(self):
537537
pm = PluginManager(hookspec.project_name, "hello_")
538+
538539
class HookSpec:
539540
@hookspec
540541
def hello_myhook(self, arg1):
@@ -551,6 +552,7 @@ def hello_myhook(self, arg1):
551552
results = pm.hook.hello_myhook(arg1=17)
552553
assert results == [18, 18]
553554

555+
554556
def test_parse_hookimpl_override():
555557
class MyPluginManager(PluginManager):
556558
def parse_hookimpl_opts(self, module_or_class, name):
@@ -572,11 +574,11 @@ class Spec:
572574
@hookspec
573575
def x1meth(self):
574576
pass
577+
575578
@hookspec
576579
def x1meth2(self):
577580
pass
578581

579-
580582
pm = MyPluginManager(hookspec.project_name)
581583
pm.register(Plugin())
582584
pm.add_hookspecs(Spec)

0 commit comments

Comments
 (0)