Skip to content

Commit ce45664

Browse files
itamarofacebook-github-bot
authored andcommitted
Patch test_posixpath for huge pwd.getpwall() output
Summary: In certain environments, `pwd.getpwall()` can return very long lists. Having the test iterate on the full list isn't very useful for the purpose of the test (it's just testing the same thing over and over), but can dramatically increase the runtime of the test (as long as ~10m). Reviewed By: parulgupta1004 Differential Revision: D69377194 fbshipit-source-id: 36dbd37eb31f228f514cf6e46ee91b8efe4a1519
1 parent a38e9ae commit ce45664

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_posixpath.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def test_expanduser_pwd(self):
347347
"no home directory on VxWorks")
348348
def test_expanduser_pwd2(self):
349349
pwd = import_helper.import_module('pwd')
350-
for e in pwd.getpwall():
350+
for e in pwd.getpwall()[:10]:
351351
name = e.pw_name
352352
home = e.pw_dir
353353
home = home.rstrip('/') or '/'

0 commit comments

Comments
 (0)