Skip to content

give hints when an assertion value is None instead of a boolean #3191

@RonnyPfannschmidt

Description

@RonnyPfannschmidt

sometimes beginners invoke code like assert something_that_asserts_and_returns_none and end up puzzled,

for reference see https://stackoverflow.com/questions/48152560/pytest-assert-has-calls-usage/48206730?noredirect=1#comment83395353_48206730

i believe it would be a nice and simple addition to give a hint in the case that a assertion value was None and this might be a misstake,

for clarity None should be tested with x is None or x is not None

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorstatus: help wanteddevelopers would like help from experts on this topictype: feature-branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions