-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathconftest.py
More file actions
56 lines (45 loc) · 1.13 KB
/
conftest.py
File metadata and controls
56 lines (45 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import subprocess
import time
import pytest
os.environ.setdefault("MEMCACHED_HOST", "localhost")
@pytest.yield_fixture(scope="session", autouse=True)
def memcached_standard_port():
p = subprocess.Popen(
["memcached"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
time.sleep(0.1)
yield p
p.kill()
p.wait()
@pytest.yield_fixture(scope="session", autouse=True)
def memcached_other_port():
p = subprocess.Popen(
["memcached", "-p5000"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
time.sleep(0.1)
yield p
p.kill()
p.wait()
@pytest.yield_fixture(scope="session", autouse=True)
def memcached_socket():
p = subprocess.Popen(
["memcached", "-s/tmp/memcached.sock"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
time.sleep(0.1)
yield p
p.kill()
p.wait()
@pytest.yield_fixture(scope="session", autouse=True)
def memcached_ipv6():
p = subprocess.Popen(
["memcached", "-l::1"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
time.sleep(0.1)
yield p
p.kill()
p.wait()