Projet

Général

Profil

0001-tests-run-postgresql-tests-by-default.patch

Frédéric Péters, 03 octobre 2014 11:42

Télécharger (1,1 ko)

Voir les différences:

Subject: [PATCH] tests: run postgresql tests by default

 tests/conftest.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
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
-