diff options
author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2018-09-10 01:21:47 +0200 |
---|---|---|
committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2018-09-10 01:21:47 +0200 |
commit | 02e53a941114297f537e3dff3f9532e2f9a6779b (patch) | |
tree | 83ae303bb60cd80d9cc7759004c67f9a56ac0ea1 | |
parent | 8c2dc4c20d08177c586152345d3e43b8795546b8 (diff) | |
download | cherrypy-git-02e53a941114297f537e3dff3f9532e2f9a6779b.tar.gz |
Put check for memcache client into fixture
-rwxr-xr-x | cherrypy/test/test_session.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cherrypy/test/test_session.py b/cherrypy/test/test_session.py index 0ac3f6c7..9cd06c9b 100755 --- a/cherrypy/test/test_session.py +++ b/cherrypy/test/test_session.py @@ -407,12 +407,16 @@ def is_memcached_present(): return bool(executable) +@pytest.fixture() +def memcached_client_present(): + pytest.importorskip('memcache') + + @pytest.fixture(scope='session') def memcached_instance(request, watcher_getter): """ Start up an instance of memcached. """ - pytest.importorskip('memcache') is_memcached_present() or pytest.skip('memcached not available') port = portend.find_available_local_port() @@ -447,6 +451,7 @@ def memcached_configured(memcached_instance, monkeypatch): platform.system() == 'Windows', reason='pytest-services helper does not work under Windows', ) +@pytest.mark.usefixtures('memcached_client_present') @pytest.mark.usefixtures('memcached_configured') class MemcachedSessionTest(helper.CPWebCase): setup_server = staticmethod(setup_server) |