tests: run postgresql tests by default

This commit is contained in:
Frédéric Péters 2014-10-03 11:36:47 +02:00
parent 240621635b
commit eda9cf94d5
1 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
import pytest
def pytest_addoption(parser):
parser.addoption('--run-postgresql', action='store_true',
help='run postgresql tests')
parser.addoption('--without-postgresql-tests', action='store_true',
help='disable tests requiring postgresql')
def pytest_runtest_setup(item):
if 'postgresql' in item.keywords and not item.config.option.run_postgresql:
pytest.skip('skipped because no --run-postgresql')
if 'postgresql' in item.keywords and item.config.option.without_postgresql_tests is True:
pytest.skip('skipped (PostgreSQL are disabled on command line)')