From 7969038573c8f2e7646a048ac8c738cd208ed571 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Sat, 9 Aug 2014 20:55:53 +0800 Subject: Remove factor negation support --- tests/test_config.py | 10 +++++----- 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() -- cgit v1.2.1