]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-136744: Remove unnecessary chmod from pydoc.apropos() test. (GH-136746...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 29 Sep 2025 08:12:31 +0000 (10:12 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Sep 2025 08:12:31 +0000 (11:12 +0300)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Lib/test/test_pydoc/test_pydoc.py

index 7623930affe4fc27ed727838871dba3fd5c72731..953cfe69f87cb8d991719481bceadee6aa612c56 100644 (file)
@@ -11,7 +11,6 @@ import keyword
 import _pickle
 import pkgutil
 import re
-import stat
 import tempfile
 import test.support
 import time
@@ -1300,27 +1299,16 @@ class PydocImportTest(PydocBaseTest):
         self.assertEqual(out.getvalue(), '')
         self.assertEqual(err.getvalue(), '')
 
-    @os_helper.skip_unless_working_chmod
     def test_apropos_empty_doc(self):
         pkgdir = os.path.join(TESTFN, 'walkpkg')
-        if support.is_emscripten:
-            # Emscripten's readdir implementation is buggy on directories
-            # with read permission but no execute permission.
-            old_umask = os.umask(0)
-            self.addCleanup(os.umask, old_umask)
         os.mkdir(pkgdir)
         self.addCleanup(rmtree, pkgdir)
         init_path = os.path.join(pkgdir, '__init__.py')
         with open(init_path, 'w') as fobj:
             fobj.write("foo = 1")
-        current_mode = stat.S_IMODE(os.stat(pkgdir).st_mode)
-        try:
-            os.chmod(pkgdir, current_mode & ~stat.S_IEXEC)
-            with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
-                pydoc.apropos('')
-            self.assertIn('walkpkg', stdout.getvalue())
-        finally:
-            os.chmod(pkgdir, current_mode)
+        with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
+            pydoc.apropos('')
+        self.assertIn('walkpkg', stdout.getvalue())
 
     def test_url_search_package_error(self):
         # URL handler search should cope with packages that raise exceptions