from ... import exc
from ... import inspect
from ... import text
+from ...testing import warn_test_suite
from ...testing.provision import create_db
from ...testing.provision import drop_all_schema_objects_post_tables
from ...testing.provision import drop_all_schema_objects_pre_tables
"and pid != pg_backend_pid()"
)
rows = result.all() # noqa
- assert not rows, (
- "PostgreSQL may not be able to DROP tables due to "
- "idle in transaction: %s"
- % ("; ".join(row._mapping["query"] for row in rows))
- )
+ if rows:
+ warn_test_suite(
+ "PostgreSQL may not be able to DROP tables due to "
+ "idle in transaction: %s"
+ % ("; ".join(row._mapping["query"] for row in rows))
+ )
from .util import run_as_contextmanager
from .util import teardown_events
from .warnings import assert_warnings
+from .warnings import warn_test_suite
def against(*queries):
from . import assertions
from .. import exc as sa_exc
+from ..util.langhelpers import _warnings_warn
+
+
+class SATestSuiteWarning(sa_exc.SAWarning):
+ """warning for a condition detected during tests that is non-fatal"""
+
+
+def warn_test_suite(message):
+ _warnings_warn(message, category=SATestSuiteWarning)
def setup_filters():
)
warnings.filterwarnings("error", category=sa_exc.SADeprecationWarning)
warnings.filterwarnings("error", category=sa_exc.SAWarning)
+ warnings.filterwarnings("always", category=SATestSuiteWarning)
# some selected deprecations...
warnings.filterwarnings("error", category=DeprecationWarning)