3232 captured_stderr , is_emscripten , is_wasi ,
3333 requires_docstrings , MISSING_C_DOCSTRINGS )
3434from test .support .os_helper import (TESTFN , rmtree , unlink )
35- from test import pydoc_mod
36- from test import pydocfodder
35+ from test . test_pydoc import pydoc_mod
36+ from test . test_pydoc import pydocfodder
3737
3838
3939class nonascii :
@@ -50,7 +50,7 @@ class nonascii:
5050
5151expected_text_pattern = """
5252NAME
53- test.pydoc_mod - This is a test module for test_pydoc
53+ test.test_pydoc. pydoc_mod - This is a test module for test_pydoc
5454%s
5555CLASSES
5656 builtins.object
@@ -123,7 +123,7 @@ class C(builtins.object)
123123
124124DATA
125125 __xyz__ = 'X, Y and Z'
126- c_alias = test.pydoc_mod.C[int]
126+ c_alias = test.test_pydoc. pydoc_mod.C[int]
127127 list_alias1 = typing.List[int]
128128 list_alias2 = list[int]
129129 type_union1 = typing.Union[int, str]
@@ -146,7 +146,7 @@ class C(builtins.object)
146146 for s in expected_data_docstrings )
147147
148148html2text_of_expected = """
149- test.pydoc_mod (version 1.2.3.4)
149+ test.test_pydoc. pydoc_mod (version 1.2.3.4)
150150This is a test module for test_pydoc
151151
152152Modules
@@ -211,7 +211,7 @@ class C(builtins.object)
211211
212212Data
213213 __xyz__ = 'X, Y and Z'
214- c_alias = test.pydoc_mod.C[int]
214+ c_alias = test.test_pydoc. pydoc_mod.C[int]
215215 list_alias1 = typing.List[int]
216216 list_alias2 = list[int]
217217 type_union1 = typing.Union[int, str]
@@ -340,7 +340,7 @@ def get_pydoc_link(module):
340340 "Returns a documentation web link of a module"
341341 abspath = os .path .abspath
342342 dirname = os .path .dirname
343- basedir = dirname (dirname (abspath (__file__ )))
343+ basedir = dirname (dirname (dirname ( abspath (__file__ ) )))
344344 doc = pydoc .TextDoc ()
345345 loc = doc .getdocloc (module , basedir = basedir )
346346 return loc
@@ -487,7 +487,7 @@ def test_not_here(self):
487487
488488 @requires_docstrings
489489 def test_not_ascii (self ):
490- result = run_pydoc ('test.test_pydoc.nonascii' , PYTHONIOENCODING = 'ascii' )
490+ result = run_pydoc ('test.test_pydoc.test_pydoc. nonascii' , PYTHONIOENCODING = 'ascii' )
491491 encoded = nonascii .__doc__ .encode ('ascii' , 'backslashreplace' )
492492 self .assertIn (encoded , result )
493493
@@ -667,9 +667,9 @@ def test_help_output_redirect(self):
667667 buf = StringIO ()
668668 helper = pydoc .Helper (output = buf )
669669 unused , doc_loc = get_pydoc_text (pydoc_mod )
670- module = "test.pydoc_mod"
670+ module = "test.test_pydoc. pydoc_mod"
671671 help_header = """
672- Help on module test.pydoc_mod in test:
672+ Help on module test.test_pydoc. pydoc_mod in test.test_pydoc :
673673
674674 """ .lstrip ()
675675 help_header = textwrap .dedent (help_header )
@@ -1050,7 +1050,6 @@ class TestDescriptions(unittest.TestCase):
10501050
10511051 def test_module (self ):
10521052 # Check that pydocfodder module can be described
1053- from test import pydocfodder
10541053 doc = pydoc .render_doc (pydocfodder )
10551054 self .assertIn ("pydocfodder" , doc )
10561055
@@ -1229,7 +1228,7 @@ def cm(cls, x):
12291228 'cm(...)\n '
12301229 ' A class method\n ' )
12311230 self .assertEqual (self ._get_summary_lines (X .cm ), """\
1232- cm(x) class method of test.test_pydoc.X
1231+ cm(x) class method of test.test_pydoc.test_pydoc. X
12331232 A class method
12341233""" )
12351234 self .assertIn ("""
@@ -1411,19 +1410,19 @@ def test_text_doc_routines_in_class(self, cls=pydocfodder.B):
14111410 lines = self .getsection (result , f' | Methods { where } :' , ' | ' + '-' * 70 )
14121411 self .assertIn (' | A_method_alias = A_method(self)' , lines )
14131412 self .assertIn (' | B_method_alias = B_method(self)' , lines )
1414- self .assertIn (' | A_staticmethod(x, y) from test.pydocfodder.A' , lines )
1413+ self .assertIn (' | A_staticmethod(x, y) from test.test_pydoc. pydocfodder.A' , lines )
14151414 self .assertIn (' | A_staticmethod_alias = A_staticmethod(x, y)' , lines )
1416- self .assertIn (' | global_func(x, y) from test.pydocfodder' , lines )
1415+ self .assertIn (' | global_func(x, y) from test.test_pydoc. pydocfodder' , lines )
14171416 self .assertIn (' | global_func_alias = global_func(x, y)' , lines )
1418- self .assertIn (' | global_func2_alias = global_func2(x, y) from test.pydocfodder' , lines )
1417+ self .assertIn (' | global_func2_alias = global_func2(x, y) from test.test_pydoc. pydocfodder' , lines )
14191418 self .assertIn (' | __repr__(self, /) from builtins.object' , lines )
14201419 self .assertIn (' | object_repr = __repr__(self, /)' , lines )
14211420
14221421 lines = self .getsection (result , f' | Static methods { where } :' , ' | ' + '-' * 70 )
1423- self .assertIn (' | A_classmethod_ref = A_classmethod(x) class method of test.pydocfodder.A' , lines )
1424- note = '' if cls is pydocfodder .B else ' class method of test.pydocfodder.B'
1422+ self .assertIn (' | A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc. pydocfodder.A' , lines )
1423+ note = '' if cls is pydocfodder .B else ' class method of test.test_pydoc. pydocfodder.B'
14251424 self .assertIn (' | B_classmethod_ref = B_classmethod(x)' + note , lines )
1426- self .assertIn (' | A_method_ref = A_method() method of test.pydocfodder.A instance' , lines )
1425+ self .assertIn (' | A_method_ref = A_method() method of test.test_pydoc. pydocfodder.A instance' , lines )
14271426 self .assertIn (' | get(key, default=None, /) method of builtins.dict instance' , lines )
14281427 self .assertIn (' | dict_get = get(key, default=None, /) method of builtins.dict instance' , lines )
14291428
@@ -1439,19 +1438,19 @@ def test_html_doc_routines_in_class(self, cls=pydocfodder.B):
14391438 lines = self .getsection (result , f'Methods { where } :' , '-' * 70 )
14401439 self .assertIn ('A_method_alias = A_method(self)' , lines )
14411440 self .assertIn ('B_method_alias = B_method(self)' , lines )
1442- self .assertIn ('A_staticmethod(x, y) from test.pydocfodder.A' , lines )
1441+ self .assertIn ('A_staticmethod(x, y) from test.test_pydoc. pydocfodder.A' , lines )
14431442 self .assertIn ('A_staticmethod_alias = A_staticmethod(x, y)' , lines )
1444- self .assertIn ('global_func(x, y) from test.pydocfodder' , lines )
1443+ self .assertIn ('global_func(x, y) from test.test_pydoc. pydocfodder' , lines )
14451444 self .assertIn ('global_func_alias = global_func(x, y)' , lines )
1446- self .assertIn ('global_func2_alias = global_func2(x, y) from test.pydocfodder' , lines )
1445+ self .assertIn ('global_func2_alias = global_func2(x, y) from test.test_pydoc. pydocfodder' , lines )
14471446 self .assertIn ('__repr__(self, /) from builtins.object' , lines )
14481447 self .assertIn ('object_repr = __repr__(self, /)' , lines )
14491448
14501449 lines = self .getsection (result , f'Static methods { where } :' , '-' * 70 )
1451- self .assertIn ('A_classmethod_ref = A_classmethod(x) class method of test.pydocfodder.A' , lines )
1452- note = '' if cls is pydocfodder .B else ' class method of test.pydocfodder.B'
1450+ self .assertIn ('A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc. pydocfodder.A' , lines )
1451+ note = '' if cls is pydocfodder .B else ' class method of test.test_pydoc. pydocfodder.B'
14531452 self .assertIn ('B_classmethod_ref = B_classmethod(x)' + note , lines )
1454- self .assertIn ('A_method_ref = A_method() method of test.pydocfodder.A instance' , lines )
1453+ self .assertIn ('A_method_ref = A_method() method of test.test_pydoc. pydocfodder.A instance' , lines )
14551454
14561455 lines = self .getsection (result , f'Class methods { where } :' , '-' * 70 )
14571456 self .assertIn ('B_classmethod(x)' , lines )
0 commit comments