Skip to content

Commit

Permalink
Chore: Fix tests on Python 3.9 and SQLAlchemy 1.3, by skipping them
Browse files Browse the repository at this point in the history
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 <class 'tests.compiler_test.SqlAlchemyDDLCompilerTest.test_ddl_with_foreign_keys.<locals>.RootStore'> class after both dependent classes have been defined.
  • Loading branch information
amotl committed Jun 13, 2024
1 parent da977d9 commit 47ccba8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/compiler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 47ccba8

Please sign in to comment.