stretchr/testify

A toolkit with common assertions and mocks that plays nicely with the standard library

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 4 minutes ago
Added to GitGenius on June 15th, 2026
Created on October 16th, 2012
Open Issues & Pull Requests: 377 (+0)
GitHub issues: Enabled
Number of forks: 1,911
Total Stargazers: 26,203 (+0)
Total Subscribers: 196 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.1 days
Mean response time: 167.0 days
90th percentile: 251.2 days
Tracked items: 210

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 82% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "assert.Eventually" is answered fastest, typically in about 5 hours, while "mock.ArgumentMatcher" waits about 4 weeks. Only 2% of issues opened in the past year have been closed. Three people close 79% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 94
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,359 days
Stale 30+ days: 87
Stale 90+ days: 82

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • enhancement (65)
  • pkg-assert (59)
  • bug (55)
  • pkg-mock (33)
  • help wanted (15)
  • mock.ArgumentMatcher (13)
  • Breaking Change (11)
  • concurrency (11)

Most active issues this week

Detailed Description

Testify is a Go testing toolkit that provides a comprehensive set of packages designed to make writing test code in Go more straightforward and expressive. The repository maintains a stable v1 API with a commitment to avoiding breaking changes, as noted in the project documentation. The toolkit addresses three core testing needs in Go: assertions, mocking, and test suite organization.

The assert package forms the foundation of testify's functionality, offering helper methods that produce friendly, readable failure descriptions when tests fail. Each assertion function accepts a testing.T object as its first argument, allowing errors to be reported through Go's standard test infrastructure. These functions return boolean values indicating success or failure, enabling developers to conditionally execute additional assertions based on prior results. For scenarios requiring multiple assertions, the require package provides identical global functions but terminates the current test immediately upon failure rather than continuing execution.

The mock package enables developers to create mock objects that substitute for real objects during testing. This package allows test authors to set up expectations and verify that those expectations were met during test execution. The testify documentation references the mockery tool as a complementary resource that can autogenerate mock code against interfaces, streamlining the mocking process.

The suite package brings object-oriented testing patterns to Go by allowing developers to structure tests as structs with setup and teardown methods. This package provides a familiar testing paradigm for developers accustomed to frameworks in other languages, though the documentation explicitly notes that the suite package does not support parallel tests. Suite objects include built-in assertion methods, integrating the assert package's capabilities directly into the testing structure.

The repository supports Go versions 1.19 and later, reflecting a focus on recent language versions. Installation is straightforward through go get, making the assert, require, mock, and suite packages immediately available to developers. The codebase uses code generation for certain files, with developers expected to run go generate to maintain generated content. The project is licensed under the MIT license and welcomes community contributions through issues and pull requests, with an active community presence in the Gophers Slack channels dedicated to testify discussion and development.