Skip to content

Feature Request: Make Eventually and Consistently fail if assertion isn't used #1562

@p-se

Description

@p-se

It is admittedly my fault that I have written a test where I did not use the return value of Eventually to make an assertion. But being human, errors happen. Trying to support humans, and considering that the functions passed to Eventually or Consistently are not even called if they don't have an assertion, why not make it fail in that case? Or at least show a warning.

I'm proposing to make

Eventually(func() error {
  return libraryClient.Connect(ctx)
}).WithContext(ctx)

throw an error or print a warning to make it clear that it isn't even called without an accompanying assertion.

Metadata

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