The v2 our tests wanted
A set of go packages that provide tools for testifying (verifying) that your code behaves as you intended.
This is the go-openapi fork of the great testify package.
[!NOTE] This is the home of
github.com/go-openapi/testify/v2, an active, opinionated fork ofgithub.com/stretchr/testify.
go-openapi/testify/v2stretchr/testify — if you already use it, our migration tool automates the switchgo.uber.org/goleak)synctest, and internal tools exposed as standalone modules (spew, unified diff, goleak)Assertion typemock package — we removed it and won't bring it back. For suites, we're open to discussion about a redesigned approachtestifylint or other tooling that expects the stretchr/testify import path2026-09-07 :
2026-08-23 :
2026-08-08 : v2.7.0 landing soon (ETA Sept. 2026)
2026-06-22 : ROADMAP to v2.7.0 (ETA Sept. 2026)
Design and exploration phase completed. The published API is now stable: moving forward, API changes will remain backward-compatible with v2.4.0.
Feedback, contributions and proposals are welcome.
Import this library in your project like so.
go get github.com/go-openapi/testify/v2
... and start writing tests. Look at our examples.
testify simplifies your test assertions like so.
import (
"testing"
)
...
const expected = "expected result"
result := printImports(input)
if result != expected {
t.Errorf(
"Expected: %s. Got: %s", expected, result,
)
return
}
Becomes:
import (
"testing"
"github.com/go-openapi/testify/v2/require"
)
...
const expected = "expected result"
require.Equalf(t,
expected, printImports(input), "Expected: %s. Got: %s",
expected, result,
)
This fork now fully replaces the original project for all go-openapi projects, thus reducing their dependencies footprint.
Go-swagger has also adopted it. Now the work is to generalize the use of generics (leveraging our migration tool).
Features might be added to support our main use cases there.
See https://github.com/go-openapi/testify/releases
SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
This library ships under the SPDX-License-Identifier: Apache-2.0.
See the license NOTICE, which recalls the licensing terms of all the pieces of software distributed with this fork, including internalized libraries.
We'd like to give credit and pay a big and loud thank you to the people who wrote these amazing pieces of software. We maintain their original work here and continue improving it.
stretchr/testify contributors - who made this new project possibleAlso special thanks to:
Maintainers can cut a new release by either:
105 followers · starred May 2026
6 followers · starred May 2026
4 followers · starred Apr 2026
11 followers · starred Jun 2026
The v2 our tests wanted
A set of go packages that provide tools for testifying (verifying) that your code behaves as you intended.
This is the go-openapi fork of the great testify package.
[!NOTE] This is the home of
github.com/go-openapi/testify/v2, an active, opinionated fork ofgithub.com/stretchr/testify.
go-openapi/testify/v2stretchr/testify — if you already use it, our migration tool automates the switchgo.uber.org/goleak)synctest, and internal tools exposed as standalone modules (spew, unified diff, goleak)Assertion typemock package — we removed it and won't bring it back. For suites, we're open to discussion about a redesigned approachtestifylint or other tooling that expects the stretchr/testify import path2026-09-07 :
2026-08-23 :
2026-08-08 : v2.7.0 landing soon (ETA Sept. 2026)
2026-06-22 : ROADMAP to v2.7.0 (ETA Sept. 2026)
Design and exploration phase completed. The published API is now stable: moving forward, API changes will remain backward-compatible with v2.4.0.
Feedback, contributions and proposals are welcome.
Import this library in your project like so.
go get github.com/go-openapi/testify/v2
... and start writing tests. Look at our examples.
testify simplifies your test assertions like so.
import (
"testing"
)
...
const expected = "expected result"
result := printImports(input)
if result != expected {
t.Errorf(
"Expected: %s. Got: %s", expected, result,
)
return
}
Becomes:
import (
"testing"
"github.com/go-openapi/testify/v2/require"
)
...
const expected = "expected result"
require.Equalf(t,
expected, printImports(input), "Expected: %s. Got: %s",
expected, result,
)
This fork now fully replaces the original project for all go-openapi projects, thus reducing their dependencies footprint.
Go-swagger has also adopted it. Now the work is to generalize the use of generics (leveraging our migration tool).
Features might be added to support our main use cases there.
See https://github.com/go-openapi/testify/releases
SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
This library ships under the SPDX-License-Identifier: Apache-2.0.
See the license NOTICE, which recalls the licensing terms of all the pieces of software distributed with this fork, including internalized libraries.
We'd like to give credit and pay a big and loud thank you to the people who wrote these amazing pieces of software. We maintain their original work here and continue improving it.
stretchr/testify contributors - who made this new project possibleAlso special thanks to:
Maintainers can cut a new release by either:
105 followers · starred May 2026
6 followers · starred May 2026
4 followers · starred Apr 2026
11 followers · starred Jun 2026