gh-64020: Deprecate pydoc.ispackage() (GH-20908)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Zackery Spytz 2023-12-27 06:04:31 -08:00 committed by GitHub
parent 4acf825058
commit 1ddd773293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View file

@ -745,14 +745,18 @@ def test_splitdoc_with_description(self):
def test_is_package_when_not_package(self):
with os_helper.temp_cwd() as test_dir:
self.assertFalse(pydoc.ispackage(test_dir))
with self.assertWarns(DeprecationWarning) as cm:
self.assertFalse(pydoc.ispackage(test_dir))
self.assertEqual(cm.filename, __file__)
def test_is_package_when_is_package(self):
with os_helper.temp_cwd() as test_dir:
init_path = os.path.join(test_dir, '__init__.py')
open(init_path, 'w').close()
self.assertTrue(pydoc.ispackage(test_dir))
with self.assertWarns(DeprecationWarning) as cm:
self.assertTrue(pydoc.ispackage(test_dir))
os.remove(init_path)
self.assertEqual(cm.filename, __file__)
def test_allmethods(self):
# issue 17476: allmethods was no longer returning unbound methods.