<!--
{
  "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/scopeProvider(for:testCase:)-9fxg4",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift Testing",
      "Testing"
    ],
    "preciseIdentifier" : "s:7Testing5TraitPAAs5NeverO17TestScopeProviderRtzrlE05scopeF03for8testCaseAESgAA0D0V_AM0J0VSgtF"
  },
  "title" : "scopeProvider(for:testCase:)"
}
-->

# scopeProvider(for:testCase:)

Get this trait’s scope provider for the specified test or test case.

```
func scopeProvider(for test: Test, testCase: Test.Case?) -> Never?
```

## Parameters

`test`

The test for which the testing library requests a
scope provider.

`testCase`

The test case for which the testing library requests a scope
provider, if any. When `test` represents a suite, the value of this argument is
`nil`.

## Discussion

The testing library uses this implementation of
`Trait/scopeProvider(for:testCase:)-cjmg` when the trait type’s
associated `Trait/TestScopeProvider` type is `Never`.

---

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)