Created
May 28, 2014 10:10
-
-
Save podhmo/1bf1d58f30e66639ff44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
import pytest | |
xs = ((1, 1, 1), | |
(3, 4, 12), | |
pytest.mark.xfail((4, 4, 8))) | |
@pytest.mark.parametrize("x, y, expected", xs) | |
def test_mul(x, y, expected): | |
assert x * y == expected | |
# py.test <filename> |
Author
podhmo
commented
May 28, 2014
pytestのparameterized testの仕方結構癖がある。pytest.mark.parametrizeに渡す文字列はwrapした関数の引数と同じ形式にする必要があった。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment