Skip to content

Commit

Permalink
Patch test_posixpath for huge pwd.getpwall() output
Browse files Browse the repository at this point in the history
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
  • Loading branch information
itamaro authored and facebook-github-bot committed Feb 11, 2025
1 parent a38e9ae commit ce45664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_expanduser_pwd(self):
"no home directory on VxWorks")
def test_expanduser_pwd2(self):
pwd = import_helper.import_module('pwd')
for e in pwd.getpwall():
for e in pwd.getpwall()[:10]:
name = e.pw_name
home = e.pw_dir
home = home.rstrip('/') or '/'
Expand Down

0 comments on commit ce45664

Please sign in to comment.