aboutsummaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-06-21 10:21:26 +0300
committerFrederick Muriuki Muriithi2022-06-21 10:21:26 +0300
commitdf0ccad74fa18d43b23cabe45a9bf268459e4151 (patch)
treeae5ff399eee8ecb530b5f575b99f7a34df17c479 /tests/conftest.py
parent69f71b1ed9b1be832af661e0d11d8bd54a696d10 (diff)
downloadgn-uploader-df0ccad74fa18d43b23cabe45a9bf268459e4151.tar.gz
Rename fixture: fixture gives back the redis url, not a server
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 0072f26..9755a47 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -21,7 +21,7 @@ def is_port_in_use(port: int) -> bool:
return sckt.connect_ex(("localhost", port)) == 0
@pytest.fixture(scope="session")
-def redis_server():
+def redis_url():
"Fixture to launch a new redis instance and return appropriate URI"
port = next(# pylint: disable=[stop-iteration-return]
port for port in range(6379,65535) if not is_port_in_use(port))
@@ -32,11 +32,11 @@ def redis_server():
process.kill()
@pytest.fixture(scope="module")
-def client(redis_server): # pylint: disable=[redefined-outer-name]
+def client(redis_url): # pylint: disable=[redefined-outer-name]
"Fixture for test client"
app = create_app(f"{os.path.abspath('.')}/tests/test_instance_dir")
app.config.update({
- "REDIS_URL": redis_server
+ "REDIS_URL": redis_url
})
yield app.test_client()