Add more decorator tests

Signed-off-by: Ray Lehtiniemi <rayl@mail.com>
This commit is contained in:
Ray Lehtiniemi
2017-03-11 14:16:23 -07:00
parent 06b6e07b98
commit 560c8ab29d
3 changed files with 11 additions and 0 deletions

View File

@@ -2,6 +2,10 @@
mod1
"""
def decorator(f):
return f
@decorator
def func1(a, b):
"""
this is func1
@@ -9,6 +13,7 @@ def func1(a, b):
return a, b
@decorator
class Class1(object):
"""
this is Class1

View File

@@ -2,6 +2,10 @@
mod2
"""
def decorator(f):
return f
@decorator
def func2(a, b):
"""
this is func2
@@ -9,6 +13,7 @@ def func2(a, b):
return a, b
@decorator
class Class2(object):
"""
this is Class2

View File

@@ -30,6 +30,7 @@ def test_viewcode(app, status, warning):
assert result.count('href="_modules/spam/mod2.html#func2"') == 2
assert result.count('href="_modules/spam/mod1.html#Class1"') == 2
assert result.count('href="_modules/spam/mod2.html#Class2"') == 2
assert result.count('@decorator') == 1
@pytest.mark.sphinx(testroot='ext-viewcode', tags=['test_linkcode'])