-
Notifications
You must be signed in to change notification settings - Fork 1
/
conftest.py
53 lines (36 loc) · 964 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from pathlib import Path
import pytest
import arrow
from structlog import get_logger
pytest_plugins = [
"virtool_workflow.pytest_plugin",
]
@pytest.fixture
def example_path():
return Path(__file__).parent / "example"
@pytest.fixture
def virtool_workflow_example_path(example_path: Path):
return example_path
@pytest.fixture
def logger():
return get_logger("workflow")
@pytest.fixture
def proc(request):
return request.config.getoption("--proc")
@pytest.fixture
def static_datetime():
return arrow.get(2020, 1, 1, 1, 1, 1).naive
@pytest.fixture
def work_path(tmpdir) -> Path:
path = Path(tmpdir) / "work"
path.mkdir()
return path
# Add an option to configure a process count.
# This is used to test the parallelism of the workflow.
def pytest_addoption(parser):
parser.addoption(
"--proc",
action="store",
default=1,
help="Number of processes allow for workflow tools",
)