Use inline list comprehension for parametrize expression

This commit is contained in:
Bruno Oliveira 2015-04-08 00:52:19 -03:00
parent 6e3c3d7a70
commit fd88311d9b

View File

@ -337,12 +337,9 @@ class TestBool:
def setup(self): def setup(self):
self.t = configtypes.Bool() self.t = configtypes.Bool()
_ALL_FORMS = [] @pytest.mark.parametrize('out, inp',
for out, inputs in TESTS.items(): [(out, inp) for out, inputs in TESTS.items() for
for inp in inputs: inp in inputs])
_ALL_FORMS.append((out, inp))
@pytest.mark.parametrize('out, inp', _ALL_FORMS)
def test_transform(self, out, inp): def test_transform(self, out, inp):
"""Test transform with all values.""" """Test transform with all values."""
assert self.t.transform(inp) == out assert self.t.transform(inp) == out