-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Optionally?) randomize arbitrary orders (e.g. listdir) #638
Comments
Looks like I just convinced myself that this would be a good idea... |
- makes the output order for os.listdir, `os.scandir` and `pathlib.Path.listdir` random - see pytest-dev#638
- makes the output order for os.listdir, `os.scandir` and `pathlib.Path.listdir` random - see pytest-dev#638
- makes the output order for os.listdir, `os.scandir` and `pathlib.Path.listdir` random - see pytest-dev#638
- makes the output order for os.listdir, `os.scandir` and `pathlib.Path.listdir` random - see #638
Should work in master now. |
…der for os.listdir, `os.scandir` and `pathlib.Path.listdir` random - see #638
Closing as fixed - feel free to reopen if this is not what you need. |
Is your feature request related to a problem? Please describe.
This sorta is related to #151; note that at this point on CPython 3.6 and Python 3.7+ we are using an ordered dictionary type, given
dict
is now ordered.But, in short, I would like to be able to test that my code doesn't rely on ordering returned by listdir.
Describe the solution you'd like
Either
listdir
should always shuffle its result or it should be an option when configuring pyfakefs, depending on whether we view the potential flakiness as a problem for CI systems.Describe alternatives you've considered
I think those are both the obvious options. I guess the other option is "continue to return items in insertion order on recent Python versions", which feels like missing test coverage.
The text was updated successfully, but these errors were encountered: