tests.connection()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4285
cc 1
1
import os
2
import pytest
3
import redis
4
5
6
@pytest.fixture()
7
def connection():
8
    host = os.environ.get('REDIS_HOST', 'localhost')
9
    port = int(os.environ.get('REDIS_PORT', 6379))
10
    db = int(os.environ.get('REDIS_DB', 0))
11
12
    return redis.StrictRedis(host=host, port=port, db=db)
13