PHP 8.2.30
Preview: warnings.py Size: 1.05 KB
//proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/alembic/testing/warnings.py

# testing/warnings.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php


import warnings

from sqlalchemy import exc as sa_exc

from ..util import sqla_14


def setup_filters():
    """Set global warning behavior for the test suite."""

    warnings.resetwarnings()

    warnings.filterwarnings("error", category=sa_exc.SADeprecationWarning)
    warnings.filterwarnings("error", category=sa_exc.SAWarning)

    # some selected deprecations...
    warnings.filterwarnings("error", category=DeprecationWarning)
    if not sqla_14:
        # 1.3 uses pkg_resources in PluginLoader
        warnings.filterwarnings(
            "ignore",
            "pkg_resources is deprecated as an API",
            DeprecationWarning,
        )
    try:
        import pytest
    except ImportError:
        pass
    else:
        warnings.filterwarnings(
            "once", category=pytest.PytestDeprecationWarning
        )

Directory Contents

Dirs: 3 × Files: 8

Name Size Perms Modified Actions
plugin DIR
- drwxr-xr-x 2026-02-06 08:01:08
Edit Download
suite DIR
- drwxr-xr-x 2026-02-06 08:01:08
Edit Download
- drwxr-xr-x 2026-02-06 08:01:08
Edit Download
4.90 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
10.50 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
8.90 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
4.82 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
4.43 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
3.27 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
1.05 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download
1.13 KB lrw-r--r-- 2026-01-20 13:01:48
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).