Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto marking of async hypothesis tests in auto mode #259

Merged
merged 2 commits into from Jan 14, 2022

Commits on Jan 13, 2022

  1. refactor: Extracted function determining whether a test function is a…

    … Hypothesis test.
    
    Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
    seifertm committed Jan 13, 2022
    Copy the full SHA
    694ebe2 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2022

  1. fix: Fixes a bug that prevents async Hypothesis tests from working wi…

    …thout explicit "asyncio" marker when "--asyncio-mode=auto" is set.
    
    The option --asyncio-mode=auto marks all async functions with the asyncio mark during the collection phase. However, when pytest collects the Hypothesis test, the @given decorator has already been applied and the Hypothesis test function is no longer a coroutine.
    
    This commit extends the "pytest_pycollect_makeitem" hook to mark Hypothesis tests whose function body is a coroutine.
    
    Closes pytest-dev#258
    
    Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
    seifertm committed Jan 14, 2022
    Copy the full SHA
    732c50b View commit details
    Browse the repository at this point in the history