Skip to content

Setup and TearDown methods don't have access to testing object #1

Open
@freeekanayaka

Description

Hi,

I like the simplicity of this package and the fact that it stays close to the standard library.

However, is there any reason for not passing the testing object to the setup/teardown methods? E.g.:

type TestSuite interface {
	SetUpSuite(t *testing.T)
	TearDownSuite(t *testing.T)
	SetUp(t *testing.T)
	TearDown(t *testing.T)
}

Otherwise a I don't see a way for a test setup to fail cleanly (think integration tests which for example try to connect to a database during setup).

Alternatively, or even additionally, the above methods could return an error, and gosuite.Run would fail the test if not nil.

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions