From 7a21f7157e940d4cdcd4284efbd5b6c023d99531 Mon Sep 17 00:00:00 2001 From: pedronis Date: Mon, 8 Sep 2008 15:02:35 +0200 Subject: [PATCH] [svn r57971] (iko, pedronis) make the Directory collection return files sorted by name again, as it seemed expected by the tests --HG-- branch : trunk --- py/test/collect.py | 2 +- py/test/testing/test_collect.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py/test/collect.py b/py/test/collect.py index 231cfc2d1..58245dfa3 100644 --- a/py/test/collect.py +++ b/py/test/collect.py @@ -398,7 +398,7 @@ class Directory(FSCollector): if l is not None: return 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) if res is not None: l.append(res) diff --git a/py/test/testing/test_collect.py b/py/test/testing/test_collect.py index de20a04a0..00e815f6e 100644 --- a/py/test/testing/test_collect.py +++ b/py/test/testing/test_collect.py @@ -87,7 +87,7 @@ class TestCollect(suptest.InlineCollection): def test_found_certain_testfiles(self): p1 = self.makepyfile(test_found = "pass", found_test="pass") 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 items[1].name == 'test_found.py' assert items[0].name == 'found_test.py'