import pytest

from .fixtures import *


def pytest_addoption(parser):
    parser.addoption("--runslow", action="store_true", help="run slow tests")


def pytest_runtest_setup(item):
    if "slow" in item.keywords and not item.config.getoption("--runslow"):
        pytest.skip("need --runslow option to run")

@@ -6,16 +6,97 @@
 t pytest
+%0Aimport os.path%0Afrom functools import lru_cache%0A%0Afrom django.conf import settings
 %0A%0Afrom .
@@ -384,8 +384,370 @@
 o run%22)%0A
+%0A@lru_cache(maxsize=4)%0Adef _get_sql():%0A    path = os.path.join(settings.BASE_DIR, %22sql%22, %22tags.sql%22)%0A    with open(path, %22r%22) as f:%0A        return f.read()%0A%0A%0Adef on_db_connect(sender, connection, **kwargs):%0A    cursor = connection.cursor()%0A    cursor.execute(_get_sql())%0A%0A%0Afrom django.db.backends import signals%0Asignals.connection_created.connect(on_db_connect)%0A

Load tags sql on connection is created on tests.