-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathconftest.py
43 lines (40 loc) · 1.17 KB
/
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
from pathlib import Path
import pytest
def pytest_addoption(parser):
parser.addoption(
"--run-c-sharp-samples",
action="store_true",
default=False,
help="Run tests for c# samples",
)
parser.addoption(
"--csharp-sample-dir",
action="store",
help="Directory with c# sample",
type=str,
default=None
)
parser.addoption(
"--run-cuda",
action="store",
help="Run cuda tests: positive, negative or skip",
type=str,
default='skip',
choices=("positive", "negative", "skip")
)
@pytest.fixture
def csharp_sample_dir(request):
if request.config.getoption("--csharp-sample-dir"):
try:
sample_exec_dir = Path(request.config.getoption("--csharp-sample-dir"))
except Exception as e:
print(e)
raise Exception("Invalid --csharp-sample-dir")
else:
sample_exec_dir = Path("..\\source\\x64\\Release")
print(f"WARNING: using default path for C# sample: {sample_exec_dir}")
yield sample_exec_dir
@pytest.fixture(scope="module")
def cuda_module():
from meshlib import mrcudapy as mc
return mc