testify icon indicating copy to clipboard operation
testify copied to clipboard

suite: fix panic if a WithStats suite skips a test early

Open segogoreng opened this issue 3 months ago • 0 comments

Summary

Continues work from https://github.com/stretchr/testify/pull/1723 by @FGasper . This PR rebases with the latest master.

This fixes issue https://github.com/stretchr/testify/issues/1722.

Changes

Prevent stats.end() if stats.start() never ran.

Motivation

Allow skipping a test in a setup/before hook. See issue https://github.com/stretchr/testify/issues/1722 for an example.

Related issues

Closes https://github.com/stretchr/testify/issues/1722

segogoreng avatar Sep 23 '25 03:09 segogoreng