summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schepanovski <suor.web@gmail.com>2014-07-03 18:22:28 +0800
committerAlexander Schepanovski <suor.web@gmail.com>2014-07-03 18:22:28 +0800
commitb445c4e81c404b991c7b643e206562ea0dc1f6b5 (patch)
tree1a418ef4d3993932a3ff7a1091bb265817438dd7
parent578c6f2e23ce585f83e27c9c5866a0e3475b965c (diff)
downloadtox-b445c4e81c404b991c7b643e206562ea0dc1f6b5.tar.gz
Test factors and envlist expansion
-rw-r--r--tests/test_config.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index ff743c4..87ed36a 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -832,6 +832,24 @@ class TestConfigTestEnv:
assert conf.changedir.basename == 'testing'
assert conf.changedir.dirpath().realpath() == tmpdir.realpath()
+ def test_factors(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = a,b
+
+ [testenv]
+ deps=
+ dep-all
+ a: dep-a
+ b: dep-b
+ !a: dep-not-a
+ """
+ conf = newconfig([], inisource)
+ configs = conf.envconfigs
+ assert [dep.name for dep in configs['a'].deps] == ["dep-all", "dep-a"]
+ assert [dep.name for dep in configs['b'].deps] == \
+ ["dep-all", "dep-b", "dep-not-a"]
+
class TestGlobalOptions:
def test_notest(self, newconfig):
config = newconfig([], "")
@@ -935,6 +953,23 @@ class TestGlobalOptions:
bp = "python%s.%s" %(name[2], name[3])
assert env.basepython == bp
+ def test_envlist_expansion(self, newconfig):
+ inisource = """
+ [tox]
+ envlist = py{26,27},docs
+ """
+ config = newconfig([], inisource)
+ assert config.envlist == ["py26", "py27", "docs"]
+
+ def test_envlist_cross_product(self, newconfig):
+ inisource = """
+ [tox]
+ envlist = py{26,27}-dep{1,2}
+ """
+ config = newconfig([], inisource)
+ assert config.envlist == \
+ ["py26-dep1", "py26-dep2", "py27-dep1", "py27-dep2"]
+
def test_minversion(self, tmpdir, newconfig, monkeypatch):
inisource = """
[tox]