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

Skip to content

Commit 5c0aa82

Browse files
Psimagetrekhleb
authored andcommitted
Fix test_glob (trekhleb#4)
* Fix test_glob == 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. * Use python3
1 parent a0b6fad commit 5c0aa82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/standard_libraries/test_glob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def test_glob():
1212
"""File Wildcards."""
1313

14-
assert glob.glob('src/standard_libraries/glob_files/*.txt') == [
14+
assert sorted(glob.glob('src/standard_libraries/glob_files/*.txt')) == sorted([
1515
'src/standard_libraries/glob_files/first_file.txt',
1616
'src/standard_libraries/glob_files/second_file.txt'
17-
]
17+
])

0 commit comments

Comments
 (0)