$33 GRAYBYTE WORDPRESS FILE MANAGER $39

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/lib/python3.7/site-packages/alembic/testing/

HOME
Current File : /opt/alt/python37/lib/python3.7/site-packages/alembic/testing//warnings.py
# testing/warnings.py
# Copyright (C) 2005-2014 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
"""NOTE:  copied/adapted from SQLAlchemy master for backwards compatibility;
   this should be removable when Alembic targets SQLAlchemy 0.9.4.
"""

from __future__ import absolute_import

import warnings
from sqlalchemy import exc as sa_exc
import re


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

    warnings.filterwarnings('ignore',
                            category=sa_exc.SAPendingDeprecationWarning)
    warnings.filterwarnings('error', category=sa_exc.SADeprecationWarning)
    warnings.filterwarnings('error', category=sa_exc.SAWarning)


def assert_warnings(fn, warning_msgs, regex=False):
    """Assert that each of the given warnings are emitted by fn."""

    from .assertions import eq_

    with warnings.catch_warnings(record=True) as log:
        # ensure that nothing is going into __warningregistry__
        warnings.filterwarnings("always")

        result = fn()
    for warning in log:
        popwarn = warning_msgs.pop(0)
        if regex:
            assert re.match(popwarn, str(warning.message))
        else:
            eq_(popwarn, str(warning.message))
    return result

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 6.48 AM
root / 996
0755
__pycache__
--
31 Aug 2024 6.48 AM
root / 996
0755
plugin
--
31 Aug 2024 6.48 AM
root / 996
0755
__init__.py
0.247 KB
17 Oct 2015 2.18 AM
root / 996
0644
assertions.py
5.773 KB
17 Oct 2015 2.18 AM
root / 996
0644
compat.py
0.303 KB
17 Oct 2015 2.18 AM
root / 996
0644
config.py
2.317 KB
17 Oct 2015 2.18 AM
root / 996
0644
engines.py
0.748 KB
17 Oct 2015 2.18 AM
root / 996
0644
env.py
7.583 KB
17 Oct 2015 2.18 AM
root / 996
0644
exclusions.py
12.485 KB
17 Oct 2015 2.18 AM
root / 996
0644
fixtures.py
4.413 KB
17 Oct 2015 2.18 AM
root / 996
0644
mock.py
0.772 KB
17 Oct 2015 2.18 AM
root / 996
0644
provision.py
4.939 KB
17 Oct 2015 2.18 AM
root / 996
0644
requirements.py
2.992 KB
17 Oct 2015 2.18 AM
root / 996
0644
runner.py
1.564 KB
17 Oct 2015 2.18 AM
root / 996
0644
util.py
0.466 KB
17 Oct 2015 2.18 AM
root / 996
0644
warnings.py
1.348 KB
17 Oct 2015 2.18 AM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF