diff options
| author | Alexander Schepanovski <suor.web@gmail.com> | 2014-08-09 20:55:53 +0800 |
|---|---|---|
| committer | Alexander Schepanovski <suor.web@gmail.com> | 2014-08-09 20:55:53 +0800 |
| commit | 7969038573c8f2e7646a048ac8c738cd208ed571 (patch) | |
| tree | 10985c64ecd83b38d97c4abd867d15ea6c44b5b1 | |
| parent | 4c5e42a3dddc75f38374e9fa68e6d6f2798ae081 (diff) | |
| download | tox-7969038573c8f2e7646a048ac8c738cd208ed571.tar.gz | |
Remove factor negation support
| -rw-r--r-- | tests/test_config.py | 10 | ||||
| -rw-r--r-- | tox/_config.py | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 28afa6c..fc429a4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -835,20 +835,20 @@ class TestConfigTestEnv: def test_factors(self, newconfig): inisource=""" [tox] - envlist = a,b + envlist = a-x,b [testenv] deps= dep-all a: dep-a b: dep-b - !a: dep-not-a + x: dep-x """ 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"] + assert [dep.name for dep in configs['a-x'].deps] == \ + ["dep-all", "dep-a", "dep-x"] + assert [dep.name for dep in configs['b'].deps] == ["dep-all", "dep-b"] def test_default_factors(self, newconfig): inisource=""" diff --git a/tox/_config.py b/tox/_config.py index 6e8e706..2503962 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -302,7 +302,7 @@ class parseini: factors = set() if section in self._cfg: for _, value in self._cfg[section].items(): - factors.update(re.findall(r'^!?(\w+)\:\s+', value, re.M)) + factors.update(re.findall(r'^(\w+)\:\s+', value, re.M)) return factors def _makeenvconfig(self, name, section, subs, config): @@ -628,12 +628,12 @@ class IniReader: def _apply_factors(self, s): def factor_line(line): - m = re.search(r'^(!)?(\w+)\:\s+(.+)', line) + m = re.search(r'^(\w+)\:\s+(.+)', line) if not m: return line - negate, factor, line = m.groups() - if bool(negate) ^ (factor in self.factors): + factor, line = m.groups() + if factor in self.factors: return line lines = s.strip().splitlines() |
