예제 #1
0
 def computed_doesnt_reflect_as_server_default(self):
     # note that this rule will go away when SQLAlchemy correctly
     # supports reflection of the "computed" construct; the element
     # will consistently be present as both column.computed and
     # column.server_default for all supported backends.
     return (self.computed_columns + exclusions.skip_if(
         ["postgresql", "oracle"],
         "backend reflects computed construct as a server default",
     ) + exclusions.skip_if(self.computed_reflects_normally))
예제 #2
0
    def flexible_fk_cascades(self):
        """target database must support ON UPDATE/DELETE..CASCADE with the
        full range of keywords (e.g. NO ACTION, etc.)"""

        return exclusions.skip_if(
            ["oracle"], "target backend has poor FK cascade syntax"
        )
예제 #3
0
    def flexible_fk_cascades(self):
        """target database must support ON UPDATE/DELETE..CASCADE with the
        full range of keywords (e.g. NO ACTION, etc.)"""

        return exclusions.skip_if(
            ["oracle"], "target backend has poor FK cascade syntax"
        )
예제 #4
0
    def schemas(self):
        """Target database must support external schemas, and have one
        named 'test_schema'."""

        return exclusions.skip_if([
            "sqlite",
            "firebird"
        ], "no schema support")
예제 #5
0
    def schemas(self):
        """Target database must support external schemas, and have one
        named 'test_schema'."""

        return exclusions.skip_if([
            "sqlite",
            "firebird"
        ], "no schema support")
예제 #6
0
    def sqlalchemy_issue_4436(self):
        def check(config):
            vers = sqla_compat._vers

            if vers == (1, 3, 0, "b1"):
                return True
            elif vers >= (1, 2, 16):
                return False
            else:
                return True

        return exclusions.skip_if(
            check, "SQLAlchemy 1.2.16, 1.3.0b2 or greater required")
예제 #7
0
    def stubs_test(self):
        def requirements():
            try:
                import black  # noqa
                import zimports  # noqa

                return False
            except Exception:
                return True

        imports = exclusions.skip_if(
            requirements, "black and zimports are required for this test")
        version = exclusions.only_if(lambda _: compat.py39,
                                     "python 3.9 is required")
        return imports + version
예제 #8
0
    def unique_constraint_reflection(self):
        def doesnt_have_check_uq_constraints(config):
            from sqlalchemy import inspect

            insp = inspect(config.db)
            try:
                insp.get_unique_constraints("x")
            except NotImplementedError:
                return True
            except TypeError:
                return True
            except Exception:
                pass
            return False

        return exclusions.skip_if(doesnt_have_check_uq_constraints)
예제 #9
0
 def python3(self):
     return exclusions.skip_if(lambda: sys.version_info < (3, ),
                               "Python version 3.xx is required.")
예제 #10
0
 def sqlalchemy_14(self):
     return exclusions.skip_if(
         lambda config: not util.sqla_14,
         "SQLAlchemy 1.4 or greater required",
     )
예제 #11
0
 def no_name_normalize(self):
     return exclusions.skip_if(
         lambda config: config.db.dialect.requires_name_normalize)
예제 #12
0
 def autoincrement_on_composite_pk(self):
     return exclusions.skip_if(["sqlite"], "not supported by database")
예제 #13
0
 def integer_subtype_comparisons(self):
     """if a compare of Integer and BigInteger is supported yet."""
     return exclusions.skip_if(["oracle"], "not supported by alembic impl")
예제 #14
0
 def unicode_string(self):
     return exclusions.skip_if(["oracle"])
예제 #15
0
 def computed_columns(self):
     # TODO: in theory if these could come from SQLAlchemy dialects
     # that would be helpful
     return self.computed_columns_api + exclusions.skip_if(
         ["postgresql < 12", "sqlite < 3.31", "mysql < 5.7"])
예제 #16
0
 def alter_column(self):
     return exclusions.skip_if(["sqlite"], "no ALTER COLUMN support")
예제 #17
0
 def sqlalchemy_issue_3740(self):
     """Fixes percent sign escaping for paramstyles that don't require it"""
     return exclusions.skip_if(
         lambda config: not util.sqla_120,
         "SQLAlchemy 1.2 or greater required",
     )
예제 #18
0
 def long_names(self):
     if sqla_compat.sqla_14:
         return exclusions.skip_if("oracle<18")
     else:
         return exclusions.skip_if("oracle")
예제 #19
0
 def alter_column(self):
     return exclusions.skip_if(["sqlite"], "no ALTER COLUMN support")
예제 #20
0
 def no_name_normalize(self):
     return exclusions.skip_if(
         lambda config: config.db.dialect.requires_name_normalize
     )
예제 #21
0
 def integer_subtype_comparisons(self):
     """if a compare of Integer and BigInteger is supported yet."""
     return exclusions.skip_if(["oracle"], "not supported by alembic impl")
예제 #22
0
 def autoincrement_on_composite_pk(self):
     return exclusions.skip_if(["sqlite"], "not supported by database")