Skip to content

Commit 9432a50

Browse files
committed
Initialize fake suite inline rather than with a top-level declaration
1 parent 6853de3 commit 9432a50

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Tests/TestingTests/Test.TraitTests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ private struct TestOnlyTrait: TestTrait {}
1919
/// A trait that applies to both
2020
private struct TestAndSuiteTrait: SuiteTrait, TestTrait {}
2121

22-
/// A stub test suite.
23-
@Suite
24-
private struct DemoTestSuite {}
25-
2622
@Suite("Test.Trait Tests")
2723
struct Test_TraitTests {
2824
@Test("Setting traits on a suite filters out non-suite traits", .tags(.traitRelated))
2925
func filterTraitsOnSuites() async throws {
3026
let mixedTraits: [any Trait] = [SuiteOnlyTrait(), TestOnlyTrait(), TestAndSuiteTrait()]
31-
var suite = try #require(await test(for: DemoTestSuite.self))
27+
var suite = Test(
28+
displayName: "Fake Suite",
29+
traits: [],
30+
sourceLocation: #_sourceLocation,
31+
containingTypeInfo: TypeInfo(describing: Void.self),
32+
)
3233

3334
// Setting the traits property should filter out non-suite traits
3435
suite.traits = mixedTraits

0 commit comments

Comments
 (0)