$87 GRAYBYTE WORDPRESS FILE MANAGER $55

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/plugin/

HOME
Current File : /opt/alt/python37/lib/python3.7/site-packages/alembic/testing/plugin//noseplugin.py
# plugin/noseplugin.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

"""
Enhance nose with extra options and behaviors for running SQLAlchemy tests.


NOTE:  copied/adapted from SQLAlchemy master for backwards compatibility;
this should be removable when Alembic targets SQLAlchemy 1.0.0.

"""

try:
    # installed by bootstrap.py
    import alembic_plugin_base as plugin_base
except ImportError:
    # assume we're a package, use traditional import
    from . import plugin_base

import os
import sys

from nose.plugins import Plugin
fixtures = None

py3k = sys.version_info >= (3, 0)


class NoseSQLAlchemy(Plugin):
    enabled = True

    name = 'sqla_testing'
    score = 100

    def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None)
            if callback_:
                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)
                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config()

    def configure(self, options, conf):
        super(NoseSQLAlchemy, self).configure(options, conf)
        plugin_base.pre_begin(options)

        plugin_base.set_coverage_flag(options.enable_plugin_coverage)

    def begin(self):
        global fixtures
        from alembic.testing import fixtures  # noqa

        plugin_base.post_begin()

    def describeTest(self, test):
        return ""

    def wantFunction(self, fn):
        return False

    def wantMethod(self, fn):
        if py3k:
            if not hasattr(fn.__self__, 'cls'):
                return False
            cls = fn.__self__.cls
        else:
            cls = fn.im_class
        return plugin_base.want_method(cls, fn)

    def wantClass(self, cls):
        return plugin_base.want_class(cls)

    def beforeTest(self, test):
        plugin_base.before_test(
            test,
            test.test.cls.__module__,
            test.test.cls, test.test.method.__name__)

    def afterTest(self, test):
        plugin_base.after_test(test)

    def startContext(self, ctx):
        if not isinstance(ctx, type) \
                or not issubclass(ctx, fixtures.TestBase):
            return
        plugin_base.start_test_class(ctx)

    def stopContext(self, ctx):
        if not isinstance(ctx, type) \
                or not issubclass(ctx, fixtures.TestBase):
            return
        plugin_base.stop_test_class(ctx)

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
__init__.py
0.144 KB
17 Oct 2015 2.18 AM
root / 996
0644
bootstrap.py
1.607 KB
17 Oct 2015 2.18 AM
root / 996
0644
noseplugin.py
2.691 KB
17 Oct 2015 2.18 AM
root / 996
0644
plugin_base.py
16.958 KB
17 Oct 2015 2.18 AM
root / 996
0644
pytestplugin.py
5.758 KB
17 Oct 2015 2.18 AM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF