From 80ae0dddf4b59855d8ae0ce470bb8d5d03b29e77 Mon Sep 17 00:00:00 2001 From: Jesse Whitehouse Date: Mon, 9 Oct 2023 12:13:54 -0400 Subject: [PATCH] Add marks for the type tests that we've reviewed. This way we can re-run all of the reviewed tests with pytest test_suite.py -m reviewed This allows us to check for regressions in a single test command rather than running each block of types individually. Signed-off-by: Jesse Whitehouse --- CONTRIBUTING.md | 3 +- src/databricks/sqlalchemy/requirements.py | 1 + src/databricks/sqlalchemy/test/test_suite.py | 65 ++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4ec73e7..c3e64a4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -155,7 +155,8 @@ python -m pytest test_suite.py --dburi \ "databricks://token:$access_token@$host?http_path=$http_path&catalog=$catalog&schema=$schema" ``` -Some of these of these tests fail currently. We're working on getting relevant tests passing and others skipped. +Some of these of these tests fail currently. We're working on getting relevant tests passing and others skipped. The tests that we've already reviewed and verified +are decorated with a pytest marker called `reviewed`. To only run these tests and check for regressions, you can add `-m reviewed` to the invocation command above. ### Code formatting diff --git a/src/databricks/sqlalchemy/requirements.py b/src/databricks/sqlalchemy/requirements.py index 0e3d2ffb..fc4910e6 100644 --- a/src/databricks/sqlalchemy/requirements.py +++ b/src/databricks/sqlalchemy/requirements.py @@ -7,6 +7,7 @@ import sqlalchemy.testing.requirements import sqlalchemy.testing.exclusions + class Requirements(sqlalchemy.testing.requirements.SuiteRequirements): @property def date_historic(self): diff --git a/src/databricks/sqlalchemy/test/test_suite.py b/src/databricks/sqlalchemy/test/test_suite.py index 055720ac..e9b36e45 100644 --- a/src/databricks/sqlalchemy/test/test_suite.py +++ b/src/databricks/sqlalchemy/test/test_suite.py @@ -29,6 +29,71 @@ class BinaryTest(BinaryTest): pass +@pytest.mark.reviewed +class BooleanTest(BooleanTest): + pass + + +@pytest.mark.reviewed +class NumericTest(NumericTest): + pass + + +@pytest.mark.reviewed +class TimeMicrosecondsTest(TimeMicrosecondsTest): + pass + + +@pytest.mark.reviewed +class TextTest(TextTest): + pass + + +@pytest.mark.reviewed +class StringTest(StringTest): + pass + + +@pytest.mark.reviewed +class DateTimeMicrosecondsTest(DateTimeMicrosecondsTest): + pass + + +@pytest.mark.reviewed +class TimestampMicrosecondsTest(TimestampMicrosecondsTest): + pass + + +@pytest.mark.reviewed +class DateTimeCoercedToDateTimeTest(DateTimeCoercedToDateTimeTest): + pass + + +@pytest.mark.reviewed +class TimeTest(TimeTest): + pass + + +@pytest.mark.reviewed +class DateTimeTest(DateTimeTest): + pass + + +@pytest.mark.reviewed +class DateTimeHistoricTest(DateTimeHistoricTest): + pass + + +@pytest.mark.reviewed +class DateTest(DateTest): + pass + + +@pytest.mark.reviewed +class DateHistoricTest(DateHistoricTest): + pass + + class FetchLimitOffsetTest(FetchLimitOffsetTest): @pytest.mark.skip( reason="Dialect should advertise which offset rules Databricks supports. Offset handling needs work."