Skip to content

Commit

Permalink
Test hook collection by project name without a spec
Browse files Browse the repository at this point in the history
Triggers a regression introduced during refactoring of the multicall
loop. Demonstrates the issue described in pytest-dev#99.
  • Loading branch information
Tyler Goodlet committed Nov 13, 2017
1 parent 4fb708b commit a16bfe3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions testing/test_method_ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,17 @@ def he_method1(self):
undo()


def test_prefix_hookimpl():
@pytest.mark.parametrize('include_hookspec', [True, False])
def test_prefix_hookimpl(include_hookspec):
pm = PluginManager(hookspec.project_name, "hello_")

class HookSpec(object):
@hookspec
def hello_myhook(self, arg1):
""" add to arg1 """
if include_hookspec:
class HookSpec(object):
@hookspec
def hello_myhook(self, arg1):
""" add to arg1 """

pm.add_hookspecs(HookSpec)
pm.add_hookspecs(HookSpec)

class Plugin(object):
def hello_myhook(self, arg1):
Expand Down

0 comments on commit a16bfe3

Please sign in to comment.