Skip to content

Remove _pytest.compat.is_generator() and just use inspect.isgeneratorfunction() directly #12960

Closed

Description

@Zac-HD

It's already equivalent in practice, and deleting the few uses and handful of tests will make it easier for contributors to understand code which uses the stdlib function instead.

While we're there, I'd like to turn the xfail on "yield tests" - a noop since Pytest 4! - into a hard error, to reduce the risk that users incorrectly believe that they're testing something.

Activity

  1. RonnyPfannschmidt commented on Nov 16, 2024

    @RonnyPfannschmidt
    Member

    go for it, thanks !

  2. Zac-HD commented on Nov 16, 2024

    @Zac-HD
    MemberAuthor
    • just the xfail, which is guarded by the condition in your diff in src/_pytest/python.py. yield fixtures are fine.
    • in test_compat.py, just delete the affected tests - we don't need tests for the stdlib function.
    • in general I'd encourage you to open a PR with your current state and ask any questions there - the review interface is really helpful for tracking work-in-progress, not just finished or polished contributions!

    and thanks for helping out!

  3. added a commit that references this issue on Nov 18, 2024
    270c24a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: refactoringinternal improvements to the code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions