<!--
{
  "availability" : [
    "Swift: 6.1.0 -",
    "Xcode: 16.3.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Trait/TestScopeProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Associated Type",
  "symbol" : {
    "kind" : "Associated Type",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing5TraitP17TestScopeProviderQa"
  },
  "title" : "TestScopeProvider"
}
-->

# TestScopeProvider

The type of the test scope provider for this trait.

```
associatedtype TestScopeProvider : TestScoping = Never
```

## Discussion

The default type is `Never`, which can’t be instantiated. The
[`scopeProvider(for:testCase:)`](/documentation/Testing/Trait/scopeProvider(for:testCase:)) method for any trait with
`Never` as its test scope provider type must return `nil`, meaning that
the trait doesn’t provide a custom scope for tests it’s applied to.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)