tests: remove custom --without-postgresql-tests test option (#39641)

pytest.config was deprecated in pytest 5 and it's not worth adapting all
tests.
This commit is contained in:
Frédéric Péters 2020-02-11 09:48:15 +01:00
parent 583d80ad06
commit 9ccf61e6c9
3 changed files with 1 additions and 15 deletions

View File

@ -6,16 +6,6 @@ import pytest
from utilities import EmailsMocking, SMSMocking, HttpRequestsMocking
def pytest_addoption(parser):
parser.addoption('--without-postgresql-tests', action='store_true',
help='disable tests requiring postgresql')
def pytest_runtest_setup(item):
if 'postgresql' in item.keywords and item.config.option.without_postgresql_tests is True:
pytest.skip('skipped (PostgreSQL are disabled on command line)')
def site_options(request, pub, section, variable, value):
config = ConfigParser.ConfigParser()
path = os.path.join(pub.app_dir, 'site-options.cfg')

View File

@ -44,10 +44,6 @@ known_elements = KnownElements()
def create_temporary_pub(sql_mode=False, templates_mode=False, lazy_mode=False):
if sql_mode is True:
if pytest.config.getoption('without_postgresql_tests'):
pytest.skip("unsupported configuration")
return
if get_publisher():
get_publisher().cleanup()
cleanup()

View File

@ -16,7 +16,7 @@ setenv =
passenv =
USER
deps =
pytest>=3.6,<5
pytest>=3.6
pytest-mock
pytest-cov
pytest-django