---
title: TestScopeProvider
framework: testing
role: symbol
role_heading: Associated Type
path: testing/trait/testscopeprovider
---

# TestScopeProvider

The type of the test scope provider for this trait.

## Declaration

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

## Discussion

Discussion The default type is Never, which can’t be instantiated. The 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.

## See Also

### Running code before and after a test or suite

- [TestScoping](testing/testscoping.md)
- [scopeProvider(for:testCase:)](testing/trait/scopeprovider(for:testcase:).md)
- [prepare(for:)](testing/trait/prepare(for:).md)
