From: Daniele Varrazzo Date: Sun, 18 Dec 2022 19:14:16 +0000 (+0000) Subject: test: drop --allow-fail and --no-collect-ok options X-Git-Tag: pool-3.1.5~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab50ae693b4d941605666dd7256773dae9999aca;p=thirdparty%2Fpsycopg.git test: drop --allow-fail and --no-collect-ok options They were needed to deal with problem caused by tox. Not needed anymore. --- diff --git a/tests/conftest.py b/tests/conftest.py index 9191e5769..15bcf4099 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,8 +3,6 @@ import asyncio import selectors from typing import List -import pytest - pytest_plugins = ( "tests.fix_db", "tests.fix_pq", @@ -41,22 +39,6 @@ def pytest_addoption(parser): help="The asyncio loop to use for async tests.", ) - parser.addoption( - "--no-collect-ok", - action="store_true", - help=( - "If no test collected, exit with 0 instead of 5 (useful with --lfnf=none)." - ), - ) - - parser.addoption( - "--allow-fail", - metavar="NUM", - type=int, - default=0, - help="Tolerate up to NUM failures. Use carefully.", - ) - def pytest_report_header(config): rv = [] @@ -102,17 +84,6 @@ def pytest_sessionfinish(session, exitstatus): # Mark the test run successful (in the sense -weak- that we didn't segfault). session.config.cache.set("segfault", False) - no_collect_ok = session.config.getoption("--no-collect-ok") - if exitstatus == pytest.ExitCode.NO_TESTS_COLLECTED and no_collect_ok: - session.exitstatus = pytest.ExitCode.OK - - allow_fail = session.config.getoption("--allow-fail") - if exitstatus == pytest.ExitCode.TESTS_FAILED: - if session.testsfailed <= allow_fail: - allow_fail_messages.append(f"Tests failed: {session.testsfailed}") - allow_fail_messages.append(f"Failures allowed: {allow_fail}") - session.exitstatus = pytest.ExitCode.OK - def pytest_terminal_summary(terminalreporter, exitstatus, config): if allow_fail_messages: