diff options
Diffstat (limited to 'tests/functional/m/monkeypatch_method.py')
| -rw-r--r-- | tests/functional/m/monkeypatch_method.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/functional/m/monkeypatch_method.py b/tests/functional/m/monkeypatch_method.py new file mode 100644 index 000000000..e8bd03aa7 --- /dev/null +++ b/tests/functional/m/monkeypatch_method.py @@ -0,0 +1,16 @@ +# pylint: disable=missing-docstring,too-few-public-methods, useless-object-inheritance +'''Test that a function is considered a method when looked up through a class.''' + +class Clazz(object): + 'test class' + + def __init__(self, value): + self.value = value + +def func(arg1, arg2): + 'function that will be used as a method' + return arg1.value + arg2 + +Clazz.method = func + +VAR = Clazz(1).method(2) |
