OSS TanbouSign in with GitHub

augment Go's standard testing package with assertions, mocks, and suites

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
26,222
Primary language
Go
License
MIT
Repository last updated
Sep 24, 2026
On this page

Overview

Testify is a testing toolkit designed to work with Go's standard testing package. It provides readable assertions through assert, fail-fast helpers through require, interface-oriented mocks through mock, and shared setup or teardown through suite.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Write concise checks with assert and fail-fast preconditions with require

assert records failures on testing.T and returns a bool so tests can decide whether to continue. require offers similar APIs but terminates the current test immediately on failure.

Sources: [2]

Use mocks and suites to isolate dependencies and share setup

mock.Mock defines method expectations and return values so tests can verify dependency interactions. The suite package groups setup, teardown, and shared state across related tests.

Sources: [2]

Best fit

Fits Go projects that want clearer assertions and mocks without replacing go test

It can be added incrementally to existing testing.T tests and is useful for unit and service-layer tests that benefit from readable expectations and dependency mocks.

Sources: [2]

Before adoption

v1.12.1 declares Go 1.17 minimum and Testify v1 is maintained without breaking changes

The v1.12.1 go.mod declares Go 1.17 as the tested minimum, while the README states that v1 will not accept breaking changes. The release also reduces the remaining dependency set. Because require uses FailNow, it must be called from the test or benchmark goroutine rather than helper goroutines.

Sources: [3][2][4]

Official sources

  1. [1]stretchr/testify — GitHub repository(2026-10-06)
  2. [2]Testify v1.12.1 — README(2026-10-06)
  3. [3]Testify v1.12.1 — go.mod(2026-10-06)
  4. [4]Testify v1.12.1 release(2026-10-06)
  5. [5]Testify MIT license(2026-10-06)
Supplemental curator note

Testify augments rather than replaces Go's standard testing package, making it easy to adopt incrementally. Because require terminates the current test via FailNow, do not call it from helper goroutines outside the test or benchmark goroutine.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/stretchr/testify.git
  2. 2

    Enter the repository

    cd testify
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

26,222 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
2
Open PRs
162

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • testify
  • go
  • assertions
  • mocking
  • golang
  • testing
  • toolkit
Stars
26,222
Forks
1,915
Watchers
195
Open issues
231
Contributors
261
Owner type
Organization
Primary language
Go
License
MIT
Repository last updated
Sep 24, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?