# XCTest is not testing a test methods defined in a generic subclass of XCTestCase

**URL:** <https://forums.swift.org/t/xctest-is-not-testing-a-test-methods-defined-in-a-generic-subclass-of-xctestcase/44695>\
**Category:** Core Libraries\
**Tags:** xctest\
**Created:** [February 12, 2021, 7:42am UTC](https://forums.swift.org/t/xctest-is-not-testing-a-test-methods-defined-in-a-generic-subclass-of-xctestcase/44695 "2021-02-12T07:42:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blazej.sleboda](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@blazej.sleboda](https://forums.swift.org/u/blazej.sleboda)\
**Post date:** [February 12, 2021, 7:42am UTC](https://forums.swift.org/t/xctest-is-not-testing-a-test-methods-defined-in-a-generic-subclass-of-xctestcase/44695/1 "2021-02-12T07:42:25Z")

</div>

Our team just discovered that Darwin's XCTest is not testing a test methods that are part of a test case which is a generic subclass of XCTestCase.

Those methods are displayed in the Test Navigator and can be executed manually but are not executed by Product-\>Tests or command line tools on CI.

On the beginning I was thinking that the problem is part of discovery tool but those test methods are displayed in the Test Navigator so maybe it's something else.

```
class MockGenerator {}

class CustomTestCase<T>: XCTestCase {}

class CustomTests: CustomTestCase<MockGenerator> {
    func testA() throws {
        XCTAssertTrue(true)
    }
}

```

---

<div class="post-metadata">

**Author:** ![ole](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ole/32/18720_2.png) [@ole](https://forums.swift.org/u/ole)\
**Post date:** [February 12, 2021, 8:23am UTC](https://forums.swift.org/t/xctest-is-not-testing-a-test-methods-defined-in-a-generic-subclass-of-xctestcase/44695/2 "2021-02-12T08:23:17Z")

</div>

I believe this is a known issue that has been fixed in Xcode 12.5 beta 1. From [the release notes](https://developer.apple.com/documentation/xcode-release-notes/xcode-12_5-beta-release-notes/):

> XCTest now automatically includes specialized subclasses of Swift generic test classes when running tests on macOS 11.3, iOS 14.5, tvOS 14.5, watchOS 7.4, or later OS versions. This allows you to use generics to improve reusability of test classes. (23493200)
