From b2f448fa9bdedee653cb6df474aab6fd85b22a51 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sat, 8 Jun 2024 21:17:50 +0200 Subject: [PATCH] Chore: Fix tests on Python 3.9 and SQLAlchemy 1.3, by skipping them We don't know which circumstances cause this problem. SQLAlchemy 1.3 is EOL anyway, so we don't care too much. sqlalchemy.exc.InvalidRequestError: When initializing mapper mapped class RootStore->root, expression 'ItemStore' failed to locate a name ('ItemStore'). If this is a class name, consider adding this relationship() to the .RootStore'> class after both dependent classes have been defined. --- tests/compiler_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/compiler_test.py b/tests/compiler_test.py index 2e6609cd..db158f6f 100644 --- a/tests/compiler_test.py +++ b/tests/compiler_test.py @@ -18,6 +18,7 @@ # However, if you have executed another commercial license agreement # with Crate these terms will supersede the license and you may use the # software solely pursuant to the terms of the relevant commercial agreement. +import sys import warnings from textwrap import dedent from unittest import mock, skipIf, TestCase @@ -288,6 +289,8 @@ def test_for_update(self): FakeCursor = MagicMock(name='FakeCursor', spec=Cursor) +@skipIf(SA_VERSION < SA_1_4 and (3, 9) <= sys.version_info < (3, 10), + "SQLAlchemy 1.3 has problems with these test cases on Python 3.9") class CompilerTestCase(TestCase): """ A base class for providing mocking infrastructure to validate the DDL compiler.