@@ -899,8 +899,17 @@ def test_duplicate_signature():
899
899
Current time.
900
900
y : ndarray
901
901
Current variable values.
902
- x : float
903
- Some parameter
902
+
903
+ * hello
904
+ * world
905
+ an_attribute : float
906
+ The docstring is printed instead
907
+ no_docstring : str
908
+ But a description
909
+ no_docstring2 : str
910
+ multiline_sentence
911
+ midword_period
912
+ no_period
904
913
905
914
Methods
906
915
-------
@@ -936,8 +945,17 @@ def test_class_members_doc():
936
945
Current time.
937
946
y : ndarray
938
947
Current variable values.
939
- x : float
940
- Some parameter
948
+
949
+ * hello
950
+ * world
951
+ an_attribute : float
952
+ The docstring is printed instead
953
+ no_docstring : str
954
+ But a description
955
+ no_docstring2 : str
956
+ multiline_sentence
957
+ midword_period
958
+ no_period
941
959
942
960
Methods
943
961
-------
@@ -954,10 +972,38 @@ def test_class_members_doc():
954
972
def test_class_members_doc_sphinx ():
955
973
class Foo :
956
974
@property
957
- def x (self ):
975
+ def an_attribute (self ):
958
976
"""Test attribute"""
959
977
return None
960
978
979
+ @property
980
+ def no_docstring (self ):
981
+ return None
982
+
983
+ @property
984
+ def no_docstring2 (self ):
985
+ return None
986
+
987
+ @property
988
+ def multiline_sentence (self ):
989
+ """This is a
990
+ sentence. It spans multiple lines."""
991
+ return None
992
+
993
+ @property
994
+ def midword_period (self ):
995
+ """The sentence for numpy.org."""
996
+ return None
997
+
998
+ @property
999
+ def no_period (self ):
1000
+ """This does not have a period
1001
+ so we truncate its summary to the first linebreak
1002
+
1003
+ Apparently.
1004
+ """
1005
+ return None
1006
+
961
1007
doc = SphinxClassDoc (Foo , class_doc_txt )
962
1008
non_blank_line_by_line_compare (str (doc ),
963
1009
"""
@@ -983,15 +1029,30 @@ def x(self):
983
1029
Current time.
984
1030
**y** : ndarray
985
1031
Current variable values.
986
- :obj:`x <x>` : float
1032
+
1033
+ * hello
1034
+ * world
1035
+ :obj:`an_attribute <an_attribute>` : float
987
1036
Test attribute
1037
+ **no_docstring** : str
1038
+ But a description
1039
+ **no_docstring2** : str
1040
+ :obj:`multiline_sentence <multiline_sentence>`
1041
+ This is a sentence.
1042
+ :obj:`midword_period <midword_period>`
1043
+ The sentence for numpy.org.
1044
+ :obj:`no_period <no_period>`
1045
+ This does not have a period
988
1046
989
1047
..
990
1048
HACK to make autogen generate docs:
991
1049
.. autosummary::
992
1050
:toctree:
993
1051
994
- x
1052
+ an_attribute
1053
+ multiline_sentence
1054
+ midword_period
1055
+ no_period
995
1056
996
1057
.. rubric:: Methods
997
1058
0 commit comments