[svn r63201] allow to specify "3*" for host specs.

--HG--
branch : trunk
This commit is contained in:
hpk
2009-03-22 02:19:57 +01:00
parent 887a837600
commit bda844b544
7 changed files with 63 additions and 48 deletions
+2 -2
View File
@@ -287,7 +287,7 @@ class TestPyTest:
""",
)
testdir.makeconftest("""
pytest_option_xspec = 'popen popen popen'.split()
pytest_option_tx = 'popen popen popen'.split()
""")
result = testdir.runpytest(p1, '-d')
result.stdout.fnmatch_lines([
@@ -319,7 +319,7 @@ class TestPyTest:
os.kill(os.getpid(), 15)
"""
)
result = testdir.runpytest(p1, '-d', '-n 3')
result = testdir.runpytest(p1, '-d', '--tx=3*popen')
result.stdout.fnmatch_lines([
"*popen*Python*",
"*popen*Python*",
+42
View File
@@ -218,6 +218,48 @@ class TestConfigApi_getcolitems:
assert col.config is config
class TestOptionsAndConfiguration:
def test_getxspecs_numprocesses(self, testdir):
config = testdir.parseconfig("-n3")
xspecs = config.getxspecs()
assert len(xspecs) == 3
def test_getxspecs(self, testdir):
testdir.chdir()
config = testdir.parseconfig("--tx=popen", "--tx", "ssh=xyz")
xspecs = config.getxspecs()
assert len(xspecs) == 2
print xspecs
assert xspecs[0].popen
assert xspecs[1].ssh == "xyz"
def test_xspecs_multiplied(self, testdir):
testdir.chdir()
xspecs = testdir.parseconfig("--tx=3*popen",).getxspecs()
assert len(xspecs) == 3
assert xspecs[1].popen
def test_getrsyncdirs(self, testdir):
config = testdir.parseconfig('--rsyncdir=' + str(testdir.tmpdir))
roots = config.getrsyncdirs()
assert len(roots) == 1 + 1
assert testdir.tmpdir in roots
def test_getrsyncdirs_with_conftest(self, testdir):
testdir.chdir()
p = py.path.local()
for bn in 'x y z'.split():
p.mkdir(bn)
testdir.makeconftest("""
rsyncdirs= 'x',
""")
config = testdir.parseconfig(testdir.tmpdir, '--rsyncdir=y', '--rsyncdir=z')
roots = config.getrsyncdirs()
assert len(roots) == 3 + 1
assert py.path.local('y') in roots
assert py.path.local('z') in roots
assert testdir.tmpdir.join('x') in roots
class TestOptionEffects: