[svn r54623] A test for 54622
Fix for running tests --HG-- branch : trunk
This commit is contained in:
parent
6e99225320
commit
4fce886def
|
@ -33,7 +33,7 @@ def itemgen(session, colitems, reporter, keyword=None):
|
|||
if isinstance(next, stopitems):
|
||||
try:
|
||||
next._skipbykeyword(keyword)
|
||||
if session.config.option.keyword_oneshot:
|
||||
if session and session.config.option.keyword_oneshot:
|
||||
keyword = None
|
||||
yield next
|
||||
except Skipped:
|
||||
|
|
|
@ -91,6 +91,19 @@ namecontent = [
|
|||
def test_three():
|
||||
assert 1
|
||||
''')),
|
||||
('testevenmore.py', py.code.Source('''
|
||||
def test_one():
|
||||
assert 1
|
||||
|
||||
def test_two():
|
||||
assert 1
|
||||
|
||||
def test_three():
|
||||
assert 1
|
||||
|
||||
def test_four():
|
||||
assert 1
|
||||
''')),
|
||||
|
||||
('testspecial_importerror.py', py.code.Source('''
|
||||
|
||||
|
|
|
@ -118,13 +118,13 @@ class TestKeywordSelection:
|
|||
assert l[0].item.name == 'test_1'
|
||||
|
||||
def test_select_starton(self):
|
||||
config = py.test.config._reparse([datadir/'testmore.py',
|
||||
'-j', '-k', "test_two"])
|
||||
config = py.test.config._reparse([datadir/'testevenmore.py',
|
||||
'-j', '-k', "test_three"])
|
||||
all = []
|
||||
session = config._getsessionclass()(config)
|
||||
session.main(all.append)
|
||||
assert len(getpassed(all)) == 2
|
||||
assert len(getskipped(all)) == 1
|
||||
assert len(getskipped(all)) == 2
|
||||
|
||||
|
||||
class TestTerminalSession:
|
||||
|
|
Loading…
Reference in New Issue