def test_addstr(self, target): # call actual = target('abc', 'def') # verify expect = 'abcdef' assert actual == expect
def test_get_my_df(self, expected, target): target = target() # pandas.DataFrame同士が同一か確認する関数 assert_frame_equal(target, expected) # numpyのarrayが同一か確認する関数 npt.assert_array_equal(target, expected)
def test_addint(self, target): # call actual = target(1, 2) # verify expect = 3 assert actual == expect
def _test_dict_stub(): from src.myapp.main import dict_stub as target assert target() == { 'name': 'Takayuki', 'age': [1, 2, 4, 5], 'work': { 'sphinx': 'committer', 'pyconjp': 'committer' } }
def test_typeerror(self, target): with pytest.raises(TypeError): target('abc', 'def')
def test_subint(self, input, expect, target): actual = target(*input) assert actual == expect, '{}.{}関数いけてねえ'.format(target.__module__, target.__name__)
def test_add_using_parametrize(self, target, a, b, expected): # call actual = target(a, b) # verify assert actual == expected