File: conftest.py

package info (click to toggle)
python-django-test-migrations 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: python: 1,479; makefile: 26
file content (16 lines) | stat: -rw-r--r-- 400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest


@pytest.fixture(scope='session')
def django_db_use_migrations(
    request,
    django_db_use_migrations,
):
    """
    Helper fixture to skip tests when ``--nomigrations`` were specified.

    Copied from https://github.com/pytest-dev/pytest-django
    """
    if not django_db_use_migrations:
        pytest.skip('--nomigrations was specified')
    return django_db_use_migrations