pytestでparametrized testを書こうとした時にハマったのでメモ

ドキュメントしっかり読んでその通りに扱えばハマったりしないのだけれど。 pytest.mark.parametrizeに渡す文字列の部分が変更されて渡されるので形式を同じにする必要があった。

Parametrizing fixtures and test functions http://pytest.org/latest/parametrize.html#pytest-mark-parametrize

gist1bf1d58f30e66639ff44

例えば"x, y, expected"の部分を"xx, yy, expected"にすると以下のようなエラーになる。

E                   ValueError: <function test_mul at 0x10dc34c20> uses no fixture 'xx'