conftest.py 706 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.

"""config for test_multiprocessing_encoder"""
import pytest


def pytest_addoption(parser):
    """Pytest hook for test_multiprocessing_encoder"""
    parser.addoption("--num-process", action="store", default=0)
    parser.addoption("--process-id", action="store", default=0)


@pytest.fixture(autouse=True)
def multiprocessing_parses(request):
    """Fixture for querying num-process and process-id"""
    if request.cls:
        request.cls.num_process = int(request.config.getoption("--num-process"))
        request.cls.process_id = int(request.config.getoption("--process-id"))