Код: Выделить всё
/tests/base/BUILD
py_library(
name="some_base",
srcs=["some_base.py"]
)
/tests/base/conftest.py
import pytest
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
result = outcome.get_result()
setattr(item, "result_" + result.when, result)
/tests/base/some_base.py
class SomeBase:
...
/tests/BUILD
py_test(
name="some_test",
srcs=["some_test.py"],
deps=["//tests/base:some_base"]
)
/tests/conftest.py
# empty content
/tests/some_test.py
import tests.base.some_base
class SomeTest(some_base.BaseClass):
...
Код: Выделить всё
pytest some_test...
Код: Выделить всё
/tests/conftest.py
import tests.base.conftest
pytest_runtest_makereport = conftest.pytest_runtest_makereport
Подробнее здесь: https://stackoverflow.com/questions/792 ... st-py-file