diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-18 23:45:21 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-18 23:45:21 -0500 |
commit | 98459628a6c4420492ebe643e633a74ef16d0f04 (patch) | |
tree | 63ff914beb5623abcd3d5dffa0d7ca908f41db56 /test | |
parent | ce3a4cf62ab3ea2fd962f5ef5928972bd6c79fab (diff) | |
download | sqlalchemy-pr/239.tar.gz |
if doc not present
Diffstat (limited to 'test')
-rw-r--r-- | test/ext/test_hybrid.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ext/test_hybrid.py b/test/ext/test_hybrid.py index 9e103d1e5..82cf1f82c 100644 --- a/test/ext/test_hybrid.py +++ b/test/ext/test_hybrid.py @@ -286,6 +286,15 @@ class MethodExpressionTest(fixtures.TestBase, AssertsCompiledSQL): "This is a class-level docstring" return func.foo(cls._value, value) + value + @hybrid.hybrid_method + def other_value(self, x): + "This is an instance-level docstring" + return int(self._value) + x + + @other_value.expression + def other_value(cls, value): + return func.foo(cls._value, value) + value + return A def test_call(self): @@ -353,12 +362,15 @@ class MethodExpressionTest(fixtures.TestBase, AssertsCompiledSQL): def test_docstring(self): A = self._fixture() eq_(A.value.__doc__, "This is a class-level docstring") + eq_(A.other_value.__doc__, "This is an instance-level docstring") a1 = A(_value=10) # a1.value is still a method, so it has a # docstring eq_(a1.value.__doc__, "This is an instance-level docstring") + eq_(a1.other_value.__doc__, "This is an instance-level docstring") + class SpecialObjectTest(fixtures.TestBase, AssertsCompiledSQL): """tests against hybrids that return a non-ClauseElement. |