def METHOD_NAME(self):
    """
    Tests the removal of packages
    """
    try:
        # Install a package to delete - If unsuccessful, skip the test
        self.run_function("pkg.install", [DEL_PKG])
        pkg_list = self.run_function("pkg.list_pkgs")
        if DEL_PKG not in pkg_list:
            self.run_function("pkg.install", [DEL_PKG])
            self.skipTest("Failed to install a package to delete")
        # Now remove the installed package
        self.run_function("pkg.remove", [DEL_PKG])
        del_list = self.run_function("pkg.list_pkgs")
        self.assertNotIn(DEL_PKG, del_list)
    except CommandExecutionError:
        self.run_function("pkg.remove", [DEL_PKG])
        raise