Files
scylladb/test/unit/conftest.py
Andrei Chekun 36ad813b94 test.py: Add the possibility to run unit tests from pytest
Add the possibility to run unit tests from pytest
2025-02-07 21:40:28 +01:00

21 lines
693 B
Python

#
# Copyright (C) 2025-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
#
from pathlib import PosixPath
from pytest import Collector
from test.pylib.cpp.common_cpp_conftest import collect_items
from test.pylib.cpp.unit.unit_facade import UnitTestFacade
def pytest_collect_file(file_path: PosixPath, parent: Collector):
"""
Method triggered automatically by pytest to collect files from a directory. Boost and unit have the same logic for
collection, the only difference in execution, and it's covered by facade
"""
if file_path.suffix == '.cc':
return collect_items(file_path, parent, facade=UnitTestFacade(parent.config))