Skip to content

nursery fixture is too error-prone #110

Open
@belm0

Description

@belm0

Even though I'm well aware of the nursery fixture's behavior of cancelling the nursery when the test function reaches end of scope, too many times I've written invalid tests that silently end without completing the test code. This is the worst kind of trap for test authors.

In hindsight, it would have been better for the nursery fixture to not automatically cancel. The test writer would have to cancel explicitly, and the utility of the fixture is simply to avoid boilerplate and extra nesting. The big advantage is that the failure mode when the test author does the wrong thing is obvious: the test will hang.

At this point, changing the nursery semantics would break the world and cause confusion. So perhaps the best we can do is add a fixture under another name, like simple_nursery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions