Created
April 24, 2015 10:55
-
-
Save hpk42/b5fce3f1666957d7234b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from _pytest.core import PluginManager | |
pm = PluginManager("devpi_server") | |
class MyHooks: | |
def devpi_server_whatever(self, arg1): | |
pass | |
pm.addhooks(MyHooks) | |
class MyPlugin1: | |
def devpi_server_whatever(self, arg1): | |
return arg1 + 1 | |
pm.register(MyPlugin1()) | |
class MyPlugin2: | |
def devpi_server_whatever(self, arg1): | |
return arg1 + 10 | |
pm.register(MyPlugin2()) | |
res = pm.hook.devpi_server_whatever(arg1=17) | |
print "result", res | |
assert res == [27, 18] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment