Skip to content

Commit 997e471

Browse files
miss-islingtonfreakboy3742zware
authored
[3.14] pythongh-136744: Remove unnecessary chmod from pydoc.apropos() test. (pythonGH-136746) (python#139242)
Co-authored-by: Russell Keith-Magee <[email protected]> Co-authored-by: Zachary Ware <[email protected]>
1 parent 91d8645 commit 997e471

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Lib/test/test_pydoc/test_pydoc.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import _pickle
1212
import pkgutil
1313
import re
14-
import stat
1514
import tempfile
1615
import test.support
1716
import time
@@ -1300,27 +1299,16 @@ def test_apropos_with_unreadable_dir(self):
13001299
self.assertEqual(out.getvalue(), '')
13011300
self.assertEqual(err.getvalue(), '')
13021301

1303-
@os_helper.skip_unless_working_chmod
13041302
def test_apropos_empty_doc(self):
13051303
pkgdir = os.path.join(TESTFN, 'walkpkg')
1306-
if support.is_emscripten:
1307-
# Emscripten's readdir implementation is buggy on directories
1308-
# with read permission but no execute permission.
1309-
old_umask = os.umask(0)
1310-
self.addCleanup(os.umask, old_umask)
13111304
os.mkdir(pkgdir)
13121305
self.addCleanup(rmtree, pkgdir)
13131306
init_path = os.path.join(pkgdir, '__init__.py')
13141307
with open(init_path, 'w') as fobj:
13151308
fobj.write("foo = 1")
1316-
current_mode = stat.S_IMODE(os.stat(pkgdir).st_mode)
1317-
try:
1318-
os.chmod(pkgdir, current_mode & ~stat.S_IEXEC)
1319-
with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
1320-
pydoc.apropos('')
1321-
self.assertIn('walkpkg', stdout.getvalue())
1322-
finally:
1323-
os.chmod(pkgdir, current_mode)
1309+
with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
1310+
pydoc.apropos('')
1311+
self.assertIn('walkpkg', stdout.getvalue())
13241312

13251313
def test_url_search_package_error(self):
13261314
# URL handler search should cope with packages that raise exceptions

0 commit comments

Comments
 (0)