FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add zip attachment type by kieran-ryan · Pull Request #889 · allure-framework/allure-python · GitHub

Add zip attachment type - #889

Merged
delatrie merged 1 commit into
allure-framework:masterfrom
kieran-ryan:feat/zip-attachment-type
Dec 29, 2025
Merged

Add zip attachment type#889
delatrie merged 1 commit into
allure-framework:masterfrom
kieran-ryan:feat/zip-attachment-type

Conversation

Copy link
Copy Markdown
Contributor

Context

Provides an attachment type for zip files.

import allure

def test_function():
    allure.attach.file(
        source="file.zip",
        attachment_type=allure.attachment_type.ZIP,
    )

This is currently mitigated by specifying the extension directly as "zip". Allure correctly infers the media type as "application/zip" while generating the reports.

import allure

def test_function():
    allure.attach.file(
        source="file.zip",
        extension="zip",
    )

Specifying the name directly is also an option to ensure the attachment retains the appropriate zip file extension. Though this replaces the unique attachment name. To render the media type within the report, either specify the type directly through attachment_type or specify the extension as above.

import allure

def test_function():
    allure.attach.file(
        source="file.zip",
        name="file.zip",
        attachment_type="application/zip",
    )

Checklist

delatrie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi, @kieran-ryan
Thank you for the contribution!

delatrie merged commit 2031724 into allure-framework:master Dec 29, 2025
46 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a ZIP AttachmentType for the Attach File keyword

2 participants


Back | FazBrowse Home | New Git URL