testify/suite
Arjun Mahishi c41592ba5f suite: fix deadlock in suite.Require()/Assert()
As pointed out in issue #1520, if the suite is not initialised properly
(buy calling the Run function), then calling suite.Require() or
suite.Assert() will result in a deadlock.

This commit fixes that by panicking if the suite is not initialised
properly. This is justified because, the suite is intended to be
triggered in the right way. If the user does not do that, this panic will
nudge them in the right direction.

It has to be a panic because, at this point, we don't have access to any
testing.T context to gracefully call a t.Fail(). Also, these two
functions are not expected to return an error.

Fixes #1520
2024-02-18 23:55:01 +05:30
..
doc.go EqualExportedValues: Handle nested pointer, slice and map fields (#1379) 2023-05-11 07:42:04 +10:00
interfaces.go Add sub-tests to Suite (#1246) 2022-11-02 21:46:59 +10:00
stats.go Add function to return if all tests in a suite passed 2020-03-11 19:42:32 +11:00
stats_test.go Add function to return if all tests in a suite passed 2020-03-11 19:42:32 +11:00
suite.go suite: fix deadlock in suite.Require()/Assert() 2024-02-18 23:55:01 +05:30
suite_test.go suite: fix deadlock in suite.Require()/Assert() 2024-02-18 23:55:01 +05:30