##// END OF EJS Templates
merged default branch into stable
merged default branch into stable

File last commit:

r5100:21ffe335 default
r5342:5c131067 merge stable
Show More
conftest.py
57 lines | 1.9 KiB | text/x-python | PythonLexer
# Copyright (C) 2010-2023 RhodeCode GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3
# (only), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This program is dual-licensed. If you wish to learn more about the
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
import pytest # noqa
# keep the imports to have a toplevel conftest.py but still importable from EE edition
from rhodecode.tests.conftest_common import ( # noqa
pytest_generate_tests,
pytest_runtest_makereport,
pytest_addoption
)
pytest_plugins = [
"rhodecode.tests.fixture_mods.fixture_pyramid",
"rhodecode.tests.fixture_mods.fixture_utils",
]
def pytest_configure(config):
from rhodecode.config import patches # noqa
def pytest_collection_modifyitems(session, config, items):
# nottest marked, compare nose, used for transition from nose to pytest
remaining = [
i for i in items if getattr(i.obj, '__test__', True)]
items[:] = remaining
# NOTE(marcink): custom test ordering, db tests and vcstests are slowest and should
# be executed at the end for faster test feedback
def sorter(item):
pos = 0
key = item._nodeid
if key.startswith('rhodecode/tests/database'):
pos = 1
elif key.startswith('rhodecode/tests/vcs_operations'):
pos = 2
return pos
items.sort(key=sorter)