0001-tests-run-postgresql-tests-by-default.patch
tests/conftest.py | ||
---|---|---|
1 | 1 |
import pytest |
2 | 2 | |
3 | 3 |
def pytest_addoption(parser): |
4 |
parser.addoption('--run-postgresql', action='store_true',
|
|
5 |
help='run postgresql tests')
|
|
4 |
parser.addoption('--without-postgresql-tests', action='store_true',
|
|
5 |
help='disable tests requiring postgresql')
|
|
6 | 6 | |
7 | 7 |
def pytest_runtest_setup(item): |
8 |
if 'postgresql' in item.keywords and not item.config.option.run_postgresql: |
|
9 |
pytest.skip('skipped because no --run-postgresql') |
|
8 |
if 'postgresql' in item.keywords and item.config.option.without_postgresql_tests is True: |
|
9 |
pytest.skip('skipped (PostgreSQL are disabled on command line)') |
|
10 |
- |