Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Миксины #22

Open
David2261 opened this issue Oct 6, 2022 · 1 comment
Open

Миксины #22

David2261 opened this issue Oct 6, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@David2261
Copy link
Owner

Нужно написать миксины для тестов функций.
Это нужно сделать в отдельной директории

@David2261 David2261 added the enhancement New feature or request label Oct 6, 2022
@David2261 David2261 self-assigned this Oct 6, 2022
@David2261
Copy link
Owner Author

Хотелось бы поменять задачу, в том что, как выяснилось не получиться написать миксин для теста, т.к. в заданную функцию нужно передать функцию и еще параметры.
Пример миксина, который я хотел сделать:

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant