Skip to content

Ensure that gevent is properly patched when invoking pytest

License

Notifications You must be signed in to change notification settings

pmdarrow/pytest-gevent

 
 

Repository files navigation

DEPRECATED

This is no longer needed as of gevent>=1.5, you can now use:

python -m gevent --module pytest ...

Build Status Azure DevOps coverage

pytest-gevent

Ensure that gevent is properly patched when invoking pytest

installation

pip install pytest-gevent

usage

wherever you'd use pytest, use pytest-gevent instead.

disabling specific patches

you can disable specific gevent patches through environment variables. for example, if you wanted to disable the ssl patch you would invoke:

PYTEST_GEVENT_PATCH_ALL_NO_SSL=1 pytest-gevent

how this works

this calls gevent.monkey.patch_all(...) and then pytest.main()

alternatives

gevent.monkey provides a cli directly, though it's quite clunky to use

python -m gevent.monkey $(which pytest) ...
# with gevent 1.5+ you'll be able to do
# python -m gevent.monkey --module pytest ...

About

Ensure that gevent is properly patched when invoking pytest

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%