def test_bubblesort__error_descending(self): list = [1, 4, 5.77, 2, "a"] with pytest.raises(TypeError): bubblesort(list, descending=True)
def test_bubblesort__on_empty_list_descending(self): assert bubblesort([], descending=True) == []
def test_bubblesort__on_single_float_descending(self): list = _create_list_of_floats(1) list_copy = list[:] assert bubblesort(list, descending=True) == sorted(list_copy, reverse=True)
def test_bubblesort__on_integers_descending(self): list = _create_list_of_integers(25) list_copy = list[:] assert bubblesort(list, descending=True) == sorted(list_copy, reverse=True)
def test_bubblesort__error(self): list = [1, 4, 5.77, 2, "a"] with pytest.raises(TypeError): bubblesort(list)
def test_bubblesort__on_single_float(self): list = _create_list_of_floats(1) list_copy = list[:] assert bubblesort(list) == sorted(list_copy)
def test_bubblesort__on_empty_list(self): assert bubblesort([]) == []
def test_bubblesort__on_integers(self): list = _create_list_of_integers(25) list_copy = list[:] assert bubblesort(list) == sorted(list_copy)