Spaces:
Running
on
Zero
Running
on
Zero
File size: 681 Bytes
c8b42eb |
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 |
import pytest
def pytest_addoption(parser):
# Add custom command-line options
parser.addoption("--encoder-name", action="store", default=None, help="Specify the encoder name to test")
parser.addoption(
"--device",
action="store",
default="cpu",
choices=["cpu", "gpu"],
help="Specify the device to use (default: cpu)",
)
@pytest.fixture
def encoder_name(request):
# Access the value of the custom option for encoder name
return request.config.getoption("--encoder-name")
@pytest.fixture
def device(request):
# Access the value of the custom option for device
return request.config.getoption("--device")
|