def marks(category, mark=None, category_marks=None, public=False):
    """Assign marks to a test or suite of tests, grouped by a category."""

    def decorator(test_item):
        if mark is None and category_marks is None:
            raise ValueError("One of mark or category_marks must be defined")
        test_item.__marks_category__ = category
        test_item.__marks_mark__ = mark
        test_item.__marks_category_marks__ = category_marks
        test_item.__marks_public__ = public
        return test_item

    return decorator