[svn r38125] run unboxed by default, split/improve tests for it
--HG-- branch : trunk
This commit is contained in:
parent
ee04997eb2
commit
938680d50f
|
@ -113,7 +113,6 @@ class RSession(AbstractSession):
|
||||||
print "Cannot use nocapture with distributed testing"
|
print "Cannot use nocapture with distributed testing"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
config = self.config
|
config = self.config
|
||||||
config.option.boxed = True
|
|
||||||
try:
|
try:
|
||||||
config.getvalue('dist_hosts')
|
config.getvalue('dist_hosts')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
|
@ -241,7 +241,7 @@ class TestSessionAndOptions:
|
||||||
session = config.initsession()
|
session = config.initsession()
|
||||||
assert session.config is config
|
assert session.config is config
|
||||||
|
|
||||||
def test_boxed_option_including_implied_from_conftest(self):
|
def test_boxed_option_default(self):
|
||||||
self.tmpdir.join("conftest.py").write("dist_hosts=[]")
|
self.tmpdir.join("conftest.py").write("dist_hosts=[]")
|
||||||
tmpdir = self.tmpdir.ensure("subdir", dir=1)
|
tmpdir = self.tmpdir.ensure("subdir", dir=1)
|
||||||
config = py.test.config._reparse([tmpdir])
|
config = py.test.config._reparse([tmpdir])
|
||||||
|
@ -249,8 +249,11 @@ class TestSessionAndOptions:
|
||||||
assert not config.option.boxed
|
assert not config.option.boxed
|
||||||
config = py.test.config._reparse(['--dist', tmpdir])
|
config = py.test.config._reparse(['--dist', tmpdir])
|
||||||
config.initsession()
|
config.initsession()
|
||||||
assert config.option.boxed
|
assert not config.option.boxed
|
||||||
|
|
||||||
|
def test_boxed_option_from_conftest(self):
|
||||||
|
self.tmpdir.join("conftest.py").write("dist_hosts=[]")
|
||||||
|
tmpdir = self.tmpdir.ensure("subdir", dir=1)
|
||||||
tmpdir.join("conftest.py").write(py.code.Source("""
|
tmpdir.join("conftest.py").write(py.code.Source("""
|
||||||
dist_hosts = []
|
dist_hosts = []
|
||||||
dist_boxed = True
|
dist_boxed = True
|
||||||
|
@ -258,6 +261,9 @@ class TestSessionAndOptions:
|
||||||
config = py.test.config._reparse(['--dist', tmpdir])
|
config = py.test.config._reparse(['--dist', tmpdir])
|
||||||
config.initsession()
|
config.initsession()
|
||||||
assert config.option.boxed
|
assert config.option.boxed
|
||||||
|
|
||||||
|
def test_boxed_option_from_conftest2(self):
|
||||||
|
tmpdir = self.tmpdir
|
||||||
tmpdir.join("conftest.py").write(py.code.Source("""
|
tmpdir.join("conftest.py").write(py.code.Source("""
|
||||||
dist_boxed = False
|
dist_boxed = False
|
||||||
"""))
|
"""))
|
||||||
|
@ -265,11 +271,9 @@ class TestSessionAndOptions:
|
||||||
assert config.option.boxed
|
assert config.option.boxed
|
||||||
config.initsession()
|
config.initsession()
|
||||||
assert config.option.boxed
|
assert config.option.boxed
|
||||||
config = py.test.config._reparse([tmpdir, '-d'])
|
|
||||||
assert not config.option.boxed
|
def test_dist_session_no_capturedisable(self):
|
||||||
config.initsession()
|
config = py.test.config._reparse([self.tmpdir, '-d', '-s'])
|
||||||
assert config.option.boxed
|
|
||||||
config = py.test.config._reparse([tmpdir, '-d', '-s'])
|
|
||||||
py.test.raises(SystemExit, "config.initsession()")
|
py.test.raises(SystemExit, "config.initsession()")
|
||||||
|
|
||||||
def test_getvalue_pathlist(self):
|
def test_getvalue_pathlist(self):
|
||||||
|
|
Loading…
Reference in New Issue