You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Хотелось бы поменять задачу, в том что, как выяснилось не получиться написать миксин для теста, т.к. в заданную функцию нужно передать функцию и еще параметры.
Пример миксина, который я хотел сделать:
def test_isinstance(function, self):
result = function(self.height, self.width)
assert isinstance(result, (int, float))
def test_type_error(function, height, width):
with pytest.raises(TypeError):
function('(17,', width)
def test_more_args_error(function, height, width):
with pytest.raises(TypeError):
function(height, width, 23.1)
def test_less_args_error(function, height, width):
with pytest.raises(TypeError):
function(height)
Нужно написать миксины для тестов функций.
Это нужно сделать в отдельной директории
The text was updated successfully, but these errors were encountered: