2021-03-17 12:20:40 +01:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
|
|
#
|
2021-06-03 08:37:05 +02:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
#
|
2021-03-17 12:20:40 +01:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
2021-06-03 08:37:05 +02:00
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
2021-03-17 12:20:40 +01:00
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
#
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
# information regarding copyright ownership.
|
|
|
|
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
def pytest_configure(config):
|
2022-02-08 21:32:10 +01:00
|
|
|
config.addinivalue_line(
|
|
|
|
"markers", "long: mark tests that take a long time to run"
|
|
|
|
)
|
2021-03-17 12:20:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
def pytest_collection_modifyitems(config, items):
|
|
|
|
# pylint: disable=unused-argument,unused-import,too-many-branches
|
|
|
|
# pylint: disable=import-outside-toplevel
|
2022-02-08 21:32:10 +01:00
|
|
|
skip_long_tests = pytest.mark.skip(
|
|
|
|
reason="need CI_ENABLE_ALL_TESTS environment variable")
|
|
|
|
if not os.environ.get("CI_ENABLE_ALL_TESTS"):
|
|
|
|
for item in items:
|
|
|
|
if "long" in item.keywords:
|
|
|
|
item.add_marker(skip_long_tests)
|