---
title: "Proposing task-local test traits for Swift Testing"
url: https://daily.dev/posts/proposing-task-local-test-traits-for-swift-testing-475cw2i7f
source_url: https://www.pointfree.co/blog/posts/217-proposing-task-local-test-traits-for-swift-testing
type: article
source: "Point-Free Pointers"
published: 2026-06-25T16:28:52.896Z
updated: 2026-06-25T17:30:04.926Z
tags: ["testing", "swift"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Proposing task-local test traits for Swift Testing

**[Point-Free Pointers](https://daily.dev/sources/pointfree)** · 2 min read · 0 upvotes · 0 comments

## Summary

Point-Free has proposed adding a native `.taskLocal` test trait to Swift Testing, eliminating the need to write custom `TestTrait`/`SuiteTrait`/`TestScoping` conformances for every task local you want to override in tests. Currently, binding a task local value for a test requires significant boilerplate per task local. The proposed `.taskLocal(FeatureFlags.$isEnabled, true)` syntax would make this universally available without any custom trait definitions, also removing the need for a dedicated test-support library just to house those traits.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.pointfree.co/blog/posts/217-proposing-task-local-test-traits-for-swift-testing>

## Similar posts on daily.dev

- [TaskLocal test traits](https://daily.dev/posts/tasklocal-test-traits-rq0egercs) · Point-Free Pointers · 0 upvotes · 0 comments
- [“Trait-ifying” our libraries to reduce transitive dependencies](https://daily.dev/posts/trait-ifying-our-libraries-to-reduce-transitive-dependencies-gsdlzsapv) · Point-Free Pointers · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#swift](https://daily.dev/tags/swift)

[View this post on daily.dev](https://daily.dev/posts/proposing-task-local-test-traits-for-swift-testing-475cw2i7f)
