Don't use parametrization for deprecated keys.
This showed up as 2400 tests for what basically is one.
This commit is contained in:
parent
120d2e12b0
commit
0f13d9325b
@ -157,14 +157,6 @@ class TestConfigParser:
|
|||||||
self.cfg.get('general', 'bar') # pylint: disable=bad-config-call
|
self.cfg.get('general', 'bar') # pylint: disable=bad-config-call
|
||||||
|
|
||||||
|
|
||||||
def keyconfig_deprecated_test_cases():
|
|
||||||
"""Generator yielding test cases (command, rgx) for TestKeyConfigParser."""
|
|
||||||
for sect in configdata.KEY_DATA.values():
|
|
||||||
for command in sect:
|
|
||||||
for rgx, _repl in configdata.CHANGED_KEY_COMMANDS:
|
|
||||||
yield (command, rgx)
|
|
||||||
|
|
||||||
|
|
||||||
class TestKeyConfigParser:
|
class TestKeyConfigParser:
|
||||||
|
|
||||||
"""Test config.parsers.keyconf.KeyConfigParser."""
|
"""Test config.parsers.keyconf.KeyConfigParser."""
|
||||||
@ -185,9 +177,12 @@ class TestKeyConfigParser:
|
|||||||
with pytest.raises(keyconf.KeyConfigError):
|
with pytest.raises(keyconf.KeyConfigError):
|
||||||
kcp._read_command(cmdline_test.cmd)
|
kcp._read_command(cmdline_test.cmd)
|
||||||
|
|
||||||
@pytest.mark.parametrize('command, rgx', keyconfig_deprecated_test_cases())
|
@pytest.mark.parametrize('rgx', [rgx for rgx, _repl
|
||||||
def test_default_config_no_deprecated(self, command, rgx):
|
in configdata.CHANGED_KEY_COMMANDS])
|
||||||
|
def test_default_config_no_deprecated(self, rgx):
|
||||||
"""Make sure the default config contains no deprecated commands."""
|
"""Make sure the default config contains no deprecated commands."""
|
||||||
|
for sect in configdata.KEY_DATA.values():
|
||||||
|
for command in sect:
|
||||||
assert rgx.match(command) is None
|
assert rgx.match(command) is None
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
Loading…
Reference in New Issue
Block a user