# combine_lists.py
#задача #автоматизация #python #pytest
def combine_lists(list1, list2):# test_combine_lists.py
return list1 + list2
import pytest
from combine_lists import combine_lists
def test_regular_lists():
assert combine_lists([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]
assert combine_lists(["apple", "banana"], ["cherry", "date"]) == ["apple", "banana", "cherry", "date"]
def test_empty_lists():
assert combine_lists([], []) == []
def test_one_empty_list():
assert combine_lists([], ["a", "b", "c"]) == ["a", "b", "c"]
assert combine_lists(["x", "y", "z"], []) == ["x", "y", "z"]
def test_mixed_elements():
assert combine_lists([1, "a", 2], ["b", 3, "c"]) == [1, "a", 2, "b", 3, "c"]
В данной задаче функция combine_lists()
принимает на вход два списка и объединяет их при помощи операции сложения списков. Тесты проверяют правильность работы функции для различных входных данных.#задача #автоматизация #python #pytest