16 lines
515 B
Python
16 lines
515 B
Python
"""The CI integration phase must never silently skip unavailable databases."""
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.hookimpl(trylast=True)
|
|
def pytest_sessionfinish(session, exitstatus):
|
|
if os.getenv("ADCLOUD_REQUIRE_INTEGRATION") != "true":
|
|
return
|
|
reporter = session.config.pluginmanager.get_plugin("terminalreporter")
|
|
if reporter and reporter.stats.get("skipped"):
|
|
reporter.write_sep("=", "Integration CI forbids skipped tests")
|
|
session.exitstatus = pytest.ExitCode.TESTS_FAILED
|