Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test the stacklevel.
  • Loading branch information
serhiy-storchaka committed Dec 27, 2023
commit 368954cd6e062e4fec3f1f6f42b83cc7971b79ab
6 changes: 4 additions & 2 deletions Lib/test/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,16 +745,18 @@ def test_splitdoc_with_description(self):

def test_is_package_when_not_package(self):
with os_helper.temp_cwd() as test_dir:
with self.assertWarns(DeprecationWarning):
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()
with self.assertWarns(DeprecationWarning):
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.
Expand Down