forked from nivlab/nivturk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
31 lines (25 loc) · 854 Bytes
/
conftest.py
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
import pytest
def pytest_addoption(parser):
parser.addoption(
"--server", action="store_true", default=False,
help="include verification of server-side values, only possible if "
"run in the directory serving the website"
)
parser.addoption(
"--loadtest", action="store_true", default=False,
help="disable redirection to proflific pages,"
"for use during load testing"
)
parser.addoption(
"--url", action="store", default="127.0.0.1:8000",
help="url for the tests to run against"
)
@pytest.fixture
def server(request):
return request.config.getoption("--server")
@pytest.fixture
def url(request):
return f'http://{request.config.getoption("--url")}/'
@pytest.fixture()
def loadtest(request):
return request.config.getoption("--loadtest")