Fix autodoc test for python 2.4
This commit is contained in:
parent
8381cc6b7d
commit
5878ca5f1a
2 changed files with 20 additions and 17 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
from autodoc import *
|
from autodoc import *
|
||||||
|
import sys
|
||||||
|
|
||||||
def check(got, expected):
|
def check(got, expected):
|
||||||
if expected != got:
|
if expected != got:
|
||||||
|
|
@ -121,22 +122,24 @@ check(A.func3static.__doc__, "\n"
|
||||||
" "
|
" "
|
||||||
)
|
)
|
||||||
|
|
||||||
check(A.variable_a.__doc__, "A_variable_a_get(self) -> int")
|
if sys.version[0:2] > (2, 4):
|
||||||
check(A.variable_b.__doc__, "A_variable_b_get(A self) -> int")
|
# Python 2.4 does not seem to work
|
||||||
check(A.variable_c.__doc__, "\n"
|
check(A.variable_a.__doc__, "A_variable_a_get(self) -> int")
|
||||||
"A_variable_c_get(self) -> int\n"
|
check(A.variable_b.__doc__, "A_variable_b_get(A self) -> int")
|
||||||
"\n"
|
check(A.variable_c.__doc__, "\n"
|
||||||
"Parameters:\n"
|
"A_variable_c_get(self) -> int\n"
|
||||||
" self: A *\n"
|
"\n"
|
||||||
"\n"
|
"Parameters:\n"
|
||||||
)
|
" self: A *\n"
|
||||||
check(A.variable_d.__doc__, "\n"
|
"\n"
|
||||||
"A_variable_d_get(A self) -> int\n"
|
)
|
||||||
"\n"
|
check(A.variable_d.__doc__, "\n"
|
||||||
"Parameters:\n"
|
"A_variable_d_get(A self) -> int\n"
|
||||||
" self: A *\n"
|
"\n"
|
||||||
"\n"
|
"Parameters:\n"
|
||||||
)
|
" self: A *\n"
|
||||||
|
"\n"
|
||||||
|
)
|
||||||
|
|
||||||
check(B.__doc__, "Proxy of C++ B class")
|
check(B.__doc__, "Proxy of C++ B class")
|
||||||
check(C.__init__.__doc__, "__init__(self, a, b, h) -> C")
|
check(C.__init__.__doc__, "__init__(self, a, b, h) -> C")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import sys
|
import sys
|
||||||
import file_test
|
import file_test
|
||||||
|
|
||||||
if sys.version_info < (3,0):
|
if sys.version[0:2] > (3, 0):
|
||||||
file_test.nfile(sys.stdout)
|
file_test.nfile(sys.stdout)
|
||||||
|
|
||||||
cstdout = file_test.GetStdOut()
|
cstdout = file_test.GetStdOut()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue