Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stretchr/testify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.7.1
Choose a base ref
...
head repository: stretchr/testify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.7.2
Choose a head ref
  • 7 commits
  • 6 files changed
  • 5 contributors

Commits on Mar 17, 2022

  1. Update versions supported to include go 1.16

    Rather than directly adding `1.16`, I thought better to reword to state the minimum version supported... this way the line doesn't have to get updated with every new release, but instead only when dropping releases.
    jeffwidman authored and boyan-soubachov committed Mar 17, 2022

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    7797738 View commit details

Commits on May 4, 2022

  1. assert: fix typo

    Signed-off-by: cuishuang <imcusg@gmail.com>
    cuishuang authored and boyan-soubachov committed May 4, 2022
    Copy the full SHA
    3586478 View commit details
  2. fix data race in the suit

    Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
    hawkingrei authored and boyan-soubachov committed May 4, 2022
    Copy the full SHA
    a409ccf View commit details
  3. use RWMutex

    Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
    hawkingrei authored and boyan-soubachov committed May 4, 2022
    Copy the full SHA
    106ec21 View commit details

Commits on May 13, 2022

  1. Bump actions/setup-go from 2 to 3.1.0

    Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.1.0.
    - [Release notes](https://github.com/actions/setup-go/releases)
    - [Commits](actions/setup-go@v2...v3.1.0)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-go
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and boyan-soubachov committed May 13, 2022
    Copy the full SHA
    6e7fab4 View commit details
  2. Update go versions in build matrix

    These are the latest versions listed on https://go.dev/dl/
    jeffwidman authored and boyan-soubachov committed May 13, 2022
    Copy the full SHA
    285adcc View commit details

Commits on Jun 6, 2022

  1. Update gopkg.in/yaml.v3

    ingwarsw authored and boyan-soubachov committed Jun 6, 2022
    1
    Copy the full SHA
    41453c0 View commit details
Showing with 17 additions and 7 deletions.
  1. +2 −2 .github/workflows/main.yml
  2. +1 −1 README.md
  3. +1 −1 assert/assertion_compare_can_convert.go
  4. +1 −1 go.mod
  5. +2 −2 go.sum
  6. +10 −0 suite/suite.go
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go_version: ["1.17.6", "1.16.5", "1.15.13"]
go_version: ["1.17.8", "1.16.15", "1.15.15"]
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3.1.0
with:
go-version: ${{ matrix.go_version }}
- run: ./.ci.gogenerate.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -323,7 +323,7 @@ To update Testify to the latest version, use `go get -u github.com/stretchr/test
Supported go versions
==================

We support the three major Go versions, which are 1.13, 1.14 and 1.15 at the moment.
We currently support the most recent major Go versions from 1.13 onward.

------

2 changes: 1 addition & 1 deletion assert/assertion_compare_can_convert.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ package assert

import "reflect"

// Wrapper around reflect.Value.CanConvert, for compatability
// Wrapper around reflect.Value.CanConvert, for compatibility
// reasons.
func canConvert(value reflect.Value, to reflect.Type) bool {
return value.CanConvert(to)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@ require (
github.com/davecgh/go-spew v1.1.0
github.com/pmezard/go-difflib v1.0.0
github.com/stretchr/objx v0.1.0
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
gopkg.in/yaml.v3 v3.0.1
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
10 changes: 10 additions & 0 deletions suite/suite.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
"reflect"
"regexp"
"runtime/debug"
"sync"
"testing"
"time"

@@ -21,24 +22,31 @@ var matchMethod = flag.String("testify.m", "", "regular expression to select tes
// retrieving the current *testing.T context.
type Suite struct {
*assert.Assertions
mu sync.RWMutex
require *require.Assertions
t *testing.T
}

// T retrieves the current *testing.T context.
func (suite *Suite) T() *testing.T {
suite.mu.RLock()
defer suite.mu.RUnlock()
return suite.t
}

// SetT sets the current *testing.T context.
func (suite *Suite) SetT(t *testing.T) {
suite.mu.Lock()
defer suite.mu.Unlock()
suite.t = t
suite.Assertions = assert.New(t)
suite.require = require.New(t)
}

// Require returns a require context for suite.
func (suite *Suite) Require() *require.Assertions {
suite.mu.Lock()
defer suite.mu.Unlock()
if suite.require == nil {
suite.require = require.New(suite.T())
}
@@ -51,6 +59,8 @@ func (suite *Suite) Require() *require.Assertions {
// assert.Assertions with require.Assertions), this method is provided so you
// can call `suite.Assert().NoError()`.
func (suite *Suite) Assert() *assert.Assertions {
suite.mu.Lock()
defer suite.mu.Unlock()
if suite.Assertions == nil {
suite.Assertions = assert.New(suite.T())
}