@@ -1927,18 +1927,28 @@ def test_text_doc_routines_in_class(self, cls=pydocfodder.B):
1927
1927
self .assertIn (' | global_func(x, y) from test.test_pydoc.pydocfodder' , lines )
1928
1928
self .assertIn (' | global_func_alias = global_func(x, y)' , lines )
1929
1929
self .assertIn (' | global_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodder' , lines )
1930
- self .assertIn (' | count(self, value, /) from builtins.list' , lines )
1931
- self .assertIn (' | list_count = count(self, value, /)' , lines )
1932
- self .assertIn (' | __repr__(self, /) from builtins.object' , lines )
1933
- self .assertIn (' | object_repr = __repr__(self, /)' , lines )
1930
+ if not support .MISSING_C_DOCSTRINGS :
1931
+ self .assertIn (' | count(self, value, /) from builtins.list' , lines )
1932
+ self .assertIn (' | list_count = count(self, value, /)' , lines )
1933
+ self .assertIn (' | __repr__(self, /) from builtins.object' , lines )
1934
+ self .assertIn (' | object_repr = __repr__(self, /)' , lines )
1935
+ else :
1936
+ self .assertIn (' | count(self, object, /) from builtins.list' , lines )
1937
+ self .assertIn (' | list_count = count(self, object, /)' , lines )
1938
+ self .assertIn (' | __repr__(...) from builtins.object' , lines )
1939
+ self .assertIn (' | object_repr = __repr__(...)' , lines )
1934
1940
1935
1941
lines = self .getsection (result , f' | Static methods { where } :' , ' | ' + '-' * 70 )
1936
1942
self .assertIn (' | A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.A' , lines )
1937
1943
note = '' if cls is pydocfodder .B else ' class method of test.test_pydoc.pydocfodder.B'
1938
1944
self .assertIn (' | B_classmethod_ref = B_classmethod(x)' + note , lines )
1939
1945
self .assertIn (' | A_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instance' , lines )
1940
- self .assertIn (' | get(key, default=None, /) method of builtins.dict instance' , lines )
1941
- self .assertIn (' | dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
1946
+ if not support .MISSING_C_DOCSTRINGS :
1947
+ self .assertIn (' | get(key, default=None, /) method of builtins.dict instance' , lines )
1948
+ self .assertIn (' | dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
1949
+ else :
1950
+ self .assertIn (' | get(...) method of builtins.dict instance' , lines )
1951
+ self .assertIn (' | dict_get = get(...) method of builtins.dict instance' , lines )
1942
1952
1943
1953
lines = self .getsection (result , f' | Class methods { where } :' , ' | ' + '-' * 70 )
1944
1954
self .assertIn (' | B_classmethod(x)' , lines )
@@ -1957,10 +1967,16 @@ def test_html_doc_routines_in_class(self, cls=pydocfodder.B):
1957
1967
self .assertIn ('global_func(x, y) from test.test_pydoc.pydocfodder' , lines )
1958
1968
self .assertIn ('global_func_alias = global_func(x, y)' , lines )
1959
1969
self .assertIn ('global_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodder' , lines )
1960
- self .assertIn ('count(self, value, /) from builtins.list' , lines )
1961
- self .assertIn ('list_count = count(self, value, /)' , lines )
1962
- self .assertIn ('__repr__(self, /) from builtins.object' , lines )
1963
- self .assertIn ('object_repr = __repr__(self, /)' , lines )
1970
+ if not support .MISSING_C_DOCSTRINGS :
1971
+ self .assertIn ('count(self, value, /) from builtins.list' , lines )
1972
+ self .assertIn ('list_count = count(self, value, /)' , lines )
1973
+ self .assertIn ('__repr__(self, /) from builtins.object' , lines )
1974
+ self .assertIn ('object_repr = __repr__(self, /)' , lines )
1975
+ else :
1976
+ self .assertIn ('count(self, object, /) from builtins.list' , lines )
1977
+ self .assertIn ('list_count = count(self, object, /)' , lines )
1978
+ self .assertIn ('__repr__(...) from builtins.object' , lines )
1979
+ self .assertIn ('object_repr = __repr__(...)' , lines )
1964
1980
1965
1981
lines = self .getsection (result , f'Static methods { where } :' , '-' * 70 )
1966
1982
self .assertIn ('A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.A' , lines )
@@ -1997,15 +2013,27 @@ def test_text_doc_routines_in_module(self):
1997
2013
self .assertIn (' A_method3 = A_method() method of B instance' , lines )
1998
2014
self .assertIn (' A_staticmethod_ref = A_staticmethod(x, y)' , lines )
1999
2015
self .assertIn (' A_staticmethod_ref2 = A_staticmethod(y) method of B instance' , lines )
2000
- self .assertIn (' get(key, default=None, /) method of builtins.dict instance' , lines )
2001
- self .assertIn (' dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
2016
+ if not support .MISSING_C_DOCSTRINGS :
2017
+ self .assertIn (' get(key, default=None, /) method of builtins.dict instance' , lines )
2018
+ self .assertIn (' dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
2019
+ else :
2020
+ self .assertIn (' get(...) method of builtins.dict instance' , lines )
2021
+ self .assertIn (' dict_get = get(...) method of builtins.dict instance' , lines )
2022
+
2002
2023
# unbound methods
2003
2024
self .assertIn (' B_method(self)' , lines )
2004
2025
self .assertIn (' B_method2 = B_method(self)' , lines )
2005
- self .assertIn (' count(self, value, /) unbound builtins.list method' , lines )
2006
- self .assertIn (' list_count = count(self, value, /) unbound builtins.list method' , lines )
2007
- self .assertIn (' __repr__(self, /) unbound builtins.object method' , lines )
2008
- self .assertIn (' object_repr = __repr__(self, /) unbound builtins.object method' , lines )
2026
+ if not support .MISSING_C_DOCSTRINGS :
2027
+ self .assertIn (' count(self, value, /) unbound builtins.list method' , lines )
2028
+ self .assertIn (' list_count = count(self, value, /) unbound builtins.list method' , lines )
2029
+ self .assertIn (' __repr__(self, /) unbound builtins.object method' , lines )
2030
+ self .assertIn (' object_repr = __repr__(self, /) unbound builtins.object method' , lines )
2031
+ else :
2032
+ self .assertIn (' count(self, object, /) unbound builtins.list method' , lines )
2033
+ self .assertIn (' list_count = count(self, object, /) unbound builtins.list method' , lines )
2034
+ self .assertIn (' __repr__(...) unbound builtins.object method' , lines )
2035
+ self .assertIn (' object_repr = __repr__(...) unbound builtins.object method' , lines )
2036
+
2009
2037
2010
2038
def test_html_doc_routines_in_module (self ):
2011
2039
doc = pydoc .HTMLDoc ()
@@ -2026,15 +2054,25 @@ def test_html_doc_routines_in_module(self):
2026
2054
self .assertIn (' A_method3 = A_method() method of B instance' , lines )
2027
2055
self .assertIn (' A_staticmethod_ref = A_staticmethod(x, y)' , lines )
2028
2056
self .assertIn (' A_staticmethod_ref2 = A_staticmethod(y) method of B instance' , lines )
2029
- self .assertIn (' get(key, default=None, /) method of builtins.dict instance' , lines )
2030
- self .assertIn (' dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
2057
+ if not support .MISSING_C_DOCSTRINGS :
2058
+ self .assertIn (' get(key, default=None, /) method of builtins.dict instance' , lines )
2059
+ self .assertIn (' dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
2060
+ else :
2061
+ self .assertIn (' get(...) method of builtins.dict instance' , lines )
2062
+ self .assertIn (' dict_get = get(...) method of builtins.dict instance' , lines )
2031
2063
# unbound methods
2032
2064
self .assertIn (' B_method(self)' , lines )
2033
2065
self .assertIn (' B_method2 = B_method(self)' , lines )
2034
- self .assertIn (' count(self, value, /) unbound builtins.list method' , lines )
2035
- self .assertIn (' list_count = count(self, value, /) unbound builtins.list method' , lines )
2036
- self .assertIn (' __repr__(self, /) unbound builtins.object method' , lines )
2037
- self .assertIn (' object_repr = __repr__(self, /) unbound builtins.object method' , lines )
2066
+ if not support .MISSING_C_DOCSTRINGS :
2067
+ self .assertIn (' count(self, value, /) unbound builtins.list method' , lines )
2068
+ self .assertIn (' list_count = count(self, value, /) unbound builtins.list method' , lines )
2069
+ self .assertIn (' __repr__(self, /) unbound builtins.object method' , lines )
2070
+ self .assertIn (' object_repr = __repr__(self, /) unbound builtins.object method' , lines )
2071
+ else :
2072
+ self .assertIn (' count(self, object, /) unbound builtins.list method' , lines )
2073
+ self .assertIn (' list_count = count(self, object, /) unbound builtins.list method' , lines )
2074
+ self .assertIn (' __repr__(...) unbound builtins.object method' , lines )
2075
+ self .assertIn (' object_repr = __repr__(...) unbound builtins.object method' , lines )
2038
2076
2039
2077
2040
2078
@unittest .skipIf (
0 commit comments