def test_exclude(self): s = Selector(Config()) c = Config() c.exclude = [re.compile(r'me')] s2 = Selector(c) assert s.matches('test_foo') assert s2.matches('test_foo') assert s.matches('test_me') assert not s2.matches('test_me')
def BlacklistConfig(blacklist_file, excludes=()): config = Config() config.verbosity = 3 config.plugins = BlacklistPlugins(blacklist_file) if excludes: config.exclude = map(re.compile, excludes) return config