[svn r57971] (iko, pedronis)

make the Directory collection return files sorted by name again, as it seemed expected by the tests

--HG--
branch : trunk
This commit is contained in:
pedronis 2008-09-08 15:02:35 +02:00
parent e29a48b575
commit 7a21f7157e
2 changed files with 2 additions and 2 deletions

View File

@ -398,7 +398,7 @@ class Directory(FSCollector):
if l is not None: if l is not None:
return l return l
l = [] l = []
for path in self.fspath.listdir(): # listdir() returns sorted order for path in self.fspath.listdir(sort=True):
res = self.consider(path, usefilters=True) res = self.consider(path, usefilters=True)
if res is not None: if res is not None:
l.append(res) l.append(res)

View File

@ -87,7 +87,7 @@ class TestCollect(suptest.InlineCollection):
def test_found_certain_testfiles(self): def test_found_certain_testfiles(self):
p1 = self.makepyfile(test_found = "pass", found_test="pass") p1 = self.makepyfile(test_found = "pass", found_test="pass")
col = py.test.collect.Directory(p1.dirpath(), config=dummyconfig) col = py.test.collect.Directory(p1.dirpath(), config=dummyconfig)
items = col.collect() items = col.collect() # Directory collect returns files sorted by name
assert len(items) == 2 assert len(items) == 2
assert items[1].name == 'test_found.py' assert items[1].name == 'test_found.py'
assert items[0].name == 'found_test.py' assert items[0].name == 'found_test.py'