Skip to content

Commit

Permalink
util/testkit: print error stack when assert error. (pingcap#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood authored Jul 2, 2016
1 parent 618a002 commit c24ef9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/testkit/testkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fmt"
"strings"

"github.com/juju/errors"
"github.com/pingcap/check"
"github.com/pingcap/tidb"
"github.com/pingcap/tidb/ast"
Expand Down Expand Up @@ -104,10 +105,10 @@ func (tk *TestKit) MustExec(sql string, args ...interface{}) {
func (tk *TestKit) MustQuery(sql string, args ...interface{}) *Result {
comment := check.Commentf("sql:%s, %v", sql, args)
rs, err := tk.Exec(sql, args...)
tk.c.Assert(err, check.IsNil, comment)
tk.c.Assert(errors.ErrorStack(err), check.Equals, "", comment)
tk.c.Assert(rs, check.NotNil, comment)
rows, err := tidb.GetRows(rs)
tk.c.Assert(err, check.IsNil, comment)
tk.c.Assert(errors.ErrorStack(err), check.Equals, "", comment)
iRows := make([][]interface{}, len(rows))
for i := range rows {
row := rows[i]
Expand Down

0 comments on commit c24ef9f

Please sign in to comment.