summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2023-12-27 14:04:31 (GMT)
committerGitHub <noreply@github.com>2023-12-27 14:04:31 (GMT)
commit1ddd773293bd692b9dbeba9be54403a7b1e95dbf (patch)
treea12e5796090c46d14d9d89382cd82045c2827e42 /Lib/test/test_pydoc.py
parent4acf825058a7785ed3d66d4f5a4991298c011f64 (diff)
downloadcpython-1ddd773293bd692b9dbeba9be54403a7b1e95dbf.zip
cpython-1ddd773293bd692b9dbeba9be54403a7b1e95dbf.tar.gz
cpython-1ddd773293bd692b9dbeba9be54403a7b1e95dbf.tar.bz2
gh-64020: Deprecate pydoc.ispackage() (GH-20908)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 982ee60..99b19d0 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -745,14 +745,18 @@ class PydocDocTest(unittest.TestCase):
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.