From 719b39b1e468abc7995862f717cfd3b3801b52a0 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Tue, 19 Nov 2024 18:10:20 -0600 Subject: [PATCH] Update sa14:scripts to ignore feature_v20 from execution --- pyproject.toml | 6 +++++- tests/test_compiler.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 84e64faf..d4935609 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,13 +84,16 @@ extra-dependencies = ["SQLAlchemy>=1.4.19,<2.0.0"] features = ["development", "pandas"] python = "3.8" +[tool.hatch.envs.sa14.scripts] +test-dialect = "pytest -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests -m \"not feature_v2\"" + [tool.hatch.envs.default.env-vars] COVERAGE_FILE = "coverage.xml" SQLACHEMY_WARN_20 = "1" [tool.hatch.envs.default.scripts] check = "pre-commit run --all-files" -test-dialect = "pytest -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests/" +test-dialect = "pytest -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests" test-dialect-compatibility = "pytest -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml tests/sqlalchemy_test_suite" test-dialect-aws = "pytest -m \"aws\" -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests/" gh-cache-sum = "python -VV | sha256sum | cut -d' ' -f1" @@ -131,4 +134,5 @@ markers = [ "requires_external_volume: tests that needs a external volume to be executed", "external: tests that could but should only run on our external CI", "feature_max_lob_size: tests that could but should only run on our external CI", + "feature_v2: tests that could but should only run on SqlAlchemy v20", ] diff --git a/tests/test_compiler.py b/tests/test_compiler.py index f3de088c..a4e4023d 100644 --- a/tests/test_compiler.py +++ b/tests/test_compiler.py @@ -2,6 +2,7 @@ # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. # +import pytest from sqlalchemy import Integer, String, and_, func, select from sqlalchemy.schema import DropColumnComment, DropTableComment from sqlalchemy.sql import column, quoted_name, table @@ -136,6 +137,7 @@ def test_division_operator_with_denominator_expr(): assert str(stmt.compile(dialect=snowdialect.dialect())) == "col1 / sqrt(col2)" +@pytest.mark.feature_v2 def test_floor_division_operator(): col1 = column("col1") col2 = column("col2") @@ -143,6 +145,7 @@ def test_floor_division_operator(): assert str(stmt.compile(dialect=snowdialect.dialect())) == "FLOOR(col1 / col2)" +@pytest.mark.feature_v2 def test_floor_division_operator_with_denominator_expr(): col1 = column("col1") col2 = column("col2")