import zipfile
import tarfile


def is_archive(filename):
    """
    Test if a given file is an archive.

    :param filename: file to test.
    :return: `True` if it is an archive.
    """
    return zipfile.is_zipfile(filename) or tarfile.is_tarfile(filename)