mirror of
https://github.com/bendtherules/pytest_gui_status.git
synced 2026-08-18 13:42:26 +00:00
Move redis tests inside TestRedisFail class
This commit is contained in:
@@ -41,7 +41,10 @@ def redis_master(request, auto_shutdown=True):
|
||||
@patch.dict("os.environ",
|
||||
{"PYTEST_STATUS_PORT": str(REDIS_TEST_PORT)})
|
||||
@patch.dict("sys.modules", {"htmlPy": mock_htmlPy_module})
|
||||
def test_redis_fail_1(tmpdir):
|
||||
class TestRedisFail(object):
|
||||
"""test that appropriate errors are raised when redis is in incorrect state / shutdown"""
|
||||
|
||||
def test_redis_fail_1(self, tmpdir):
|
||||
# load new redis port
|
||||
import pytest_gui_status.status_gui.gui_backend as gui_backend
|
||||
reload_2_3(pytest_gui_status.utils)
|
||||
@@ -66,11 +69,7 @@ def test_redis_fail_1(tmpdir):
|
||||
assert str(error_info.value) == "Cant connect to this socket. Is redis running?\n" \
|
||||
+ "Stopping pytest_status_gui"
|
||||
|
||||
|
||||
@patch.dict("os.environ",
|
||||
{"PYTEST_STATUS_PORT": str(REDIS_TEST_PORT)})
|
||||
@patch.dict("sys.modules", {"htmlPy": mock_htmlPy_module})
|
||||
def test_redis_fail_2(tmpdir, redis_master):
|
||||
def test_redis_fail_2(self, tmpdir, redis_master):
|
||||
# load new redis port
|
||||
import pytest_gui_status.status_gui.gui_backend as gui_backend
|
||||
reload_2_3(pytest_gui_status.utils)
|
||||
@@ -98,11 +97,7 @@ def test_redis_fail_2(tmpdir, redis_master):
|
||||
|
||||
# auto cleanup of redis master by fixture
|
||||
|
||||
|
||||
@patch.dict("os.environ",
|
||||
{"PYTEST_STATUS_PORT": str(REDIS_TEST_PORT)})
|
||||
@patch.dict("sys.modules", {"htmlPy": mock_htmlPy_module})
|
||||
def test_redis_fail_3(tmpdir, redis_master):
|
||||
def test_redis_fail_3(self, tmpdir, redis_master):
|
||||
# load new redis port
|
||||
import pytest_gui_status.status_gui.gui_backend as gui_backend
|
||||
reload_2_3(pytest_gui_status.utils)
|
||||
@@ -129,11 +124,7 @@ def test_redis_fail_3(tmpdir, redis_master):
|
||||
|
||||
# auto cleanup of redis master by fixture
|
||||
|
||||
|
||||
@patch.dict("os.environ",
|
||||
{"PYTEST_STATUS_PORT": str(REDIS_TEST_PORT)})
|
||||
@patch.dict("sys.modules", {"htmlPy": mock_htmlPy_module})
|
||||
def test_redis_fail_4(tmpdir, redis_master):
|
||||
def test_redis_fail_4(self, tmpdir, redis_master):
|
||||
# load new redis port
|
||||
import pytest_gui_status.status_gui.gui_backend as gui_backend
|
||||
reload_2_3(pytest_gui_status.utils)
|
||||
|
||||
Reference in New Issue
Block a user