Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix test_glob #4

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

Merged
merged 2 commits into from
Sep 5, 2018
Merged

Fix test_glob #4

merged 2 commits into from
Sep 5, 2018

Conversation

Psimage
Copy link
Contributor

@Psimage Psimage commented Sep 5, 2018

== operator for lists relies on the order of elements in the list.
In my case, on Linux Mint, python3.6 glob() returned list had items in reverse order then expected in the test.
The glob() doc doesn't specify items ordering.
Lets sort both lists before comparison using sorted() built-in.

== operator for lists relies on the order of elements in the list. cmp() does not.
In my case, on Linux Mint, python3.6 glob() returned list had items in reverse order then expected in the test.
The glob() doc doesn't specify specific ordering.
cmp() for list objects doesn't rely on the order of items and produces the right result.
@trekhleb
Copy link
Owner

trekhleb commented Sep 5, 2018

Hi @Psimage. Thank you for the PR. Sure, let's sort the lists.

@trekhleb trekhleb merged commit 5c0aa82 into trekhleb:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants