From c020db8cd21cb221cfbe36b264e0ec02999596ed Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Thu, 19 Jul 2018 02:30:33 +0200 Subject: Abort a test on nil containers, so that future tests don't panic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač Closes: #1111 Approved by: baude --- libpod/common_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libpod') diff --git a/libpod/common_test.go b/libpod/common_test.go index d2379c508..543242130 100644 --- a/libpod/common_test.go +++ b/libpod/common_test.go @@ -12,6 +12,7 @@ import ( "github.com/cri-o/ocicni/pkg/ocicni" "github.com/opencontainers/runtime-tools/generate" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func getTestContainer(id, name, locksDir string) (*Container, error) { @@ -148,8 +149,8 @@ func testContainersEqual(t *testing.T, a, b *Container) { if a == nil && b == nil { return } - assert.NotNil(t, a) - assert.NotNil(t, b) + require.NotNil(t, a) + require.NotNil(t, b) assert.NotNil(t, a.config) assert.NotNil(t, b.config) -- cgit v1.2.3-54-g00ecf