Attachments
Last updated on June 17, 2026
You can attach files or data to test reports during execution.
TofuPilot automatically stores attachments with test results and uploads them to your Dashboard when configured.
File
You can use attach.file() to attach an existing file from the filesystem.
def test_device(attach, camera):
photo_path = camera.take_photo()
attach.file(photo_path) You can rename the attachment by providing a second parameter.
def test_device(attach, camera):
photo_path = camera.take_photo()
attach.file(photo_path, "device_photo.jpg") Data
You can use attach.data() to attach binary data directly without writing to disk first.
import json
def test_device(attach, device):
diagnostics = device.run_diagnostics()
data = json.dumps(diagnostics, indent=2).encode()
attach.data(data, "diagnostics.json") Where image attachments appear
Image attachments (PNG, JPEG, GIF, WebP, BMP, AVIF, ICO) render inline in the operator UI. Other file types show as a labeled row.
The local station kiosk renders an image attachment the moment you attach it, served from a local scratch copy while the run is live. Once the run uploads to the Dashboard the local copy is removed, so the kiosk shows the image during the run, not after.
The Dashboard renders an image attachment after its upload completes, and keeps it with the run for later review. A run viewed remotely while it executes shows each image as it finishes uploading.
How is this guide?