[svn r62985] rewrite and fix a skipped test

--HG--
branch : trunk
This commit is contained in:
hpk 2009-03-17 08:35:58 +01:00
parent 009ac242c6
commit 6397c38725
2 changed files with 6 additions and 11 deletions

View File

@ -60,6 +60,8 @@ class Session(object):
for x in self.genitems(ev.result, keywordexpr):
yield x
notify("collectionreport", ev)
if self.shouldstop:
break
def filteritems(self, colitems):
""" return items to process (some may be deselected)"""

View File

@ -213,17 +213,10 @@ class TestNewSession(SessionTests):
assert len(colfail) == 1
assert len(colskipped) == 1
def test_minus_x_import_error(self):
py.test.skip("fails")
o = self.tmpdir
tfile = o.join('test_one.py').write(py.code.Source("""
xxxx
"""))
tfile2 = o.join('test_two.py').write(py.code.Source("""
yyyyy
"""))
sorter = self.events_from_cmdline('-x')
finished = sorter.get(event.CollectionReport)
def test_minus_x_import_error(self, testdir):
testdir.makepyfile(test_one="xxxx", test_two="yyyy")
sorter = testdir.inline_run("-x", testdir.tmpdir)
finished = sorter.getnamed("collectionreport")
colfail = [x for x in finished if x.failed]
assert len(colfail) == 1