]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
test related fixes
authorFederico Caselli <cfederico87@gmail.com>
Wed, 5 Mar 2025 18:28:30 +0000 (19:28 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 5 Mar 2025 19:43:02 +0000 (20:43 +0100)
improve test error logging
remove obsolete emulated pipeline
fix test in python 3.8
add order to test

Change-Id: I2003f256a2690ee5673c72e2f1cb1340af750f83

.github/workflows/run-test.yaml
test/ext/asyncio/test_engine_py3k.py
test/sql/test_types.py
test/typing/plain_files/sql/common_sql_element.py

index b4dea776f05ae2371bc386f2e716937e11e09ab8..6c93ef1b4f7f09f8832fe76dc8272b85f32226d6 100644 (file)
@@ -129,47 +129,6 @@ jobs:
         run: tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}
         continue-on-error: ${{ matrix.python-version == 'pypy-3.10' }}
 
-  run-test-arm64:
-    # Hopefully something native can be used at some point https://github.blog/changelog/2023-10-30-accelerate-your-ci-cd-with-arm-based-hosted-runners-in-github-actions/
-    name: test-arm64-${{ matrix.python-version }}-${{ matrix.build-type }}-${{ matrix.os }}
-    runs-on: ubuntu-22.04
-    strategy:
-      matrix:
-        python-version:
-          - cp37-cp37m
-          - cp38-cp38
-          - cp39-cp39
-          - cp310-cp310
-          - cp311-cp311
-          - cp312-cp312
-          - cp313-cp313
-        build-type:
-          - "cext"
-          - "nocext"
-
-      fail-fast: false
-
-    steps:
-      - name: Checkout repo
-        uses: actions/checkout@v4
-
-      - name: Set up emulation
-        run: |
-          docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
-
-      - name: Run tests
-        uses: docker://quay.io/pypa/manylinux2014_aarch64
-        with:
-          args: |
-            bash -c "
-            export PATH=/opt/python/${{ matrix.python-version }}/bin:$PATH &&
-            python --version &&
-            python -m pip install --upgrade pip &&
-            pip install --upgrade tox setuptools &&
-            pip list &&
-            tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}
-            "
-
   run-tox:
     name: ${{ matrix.tox-env }}-${{ matrix.python-version }}
     runs-on: ${{ matrix.os }}
index 6be408ecaeaa5b2a14ca1b1efb0863503eb6d367..231d32cbe180909e8d81cfee596db0ee8870bd2c 100644 (file)
@@ -1335,11 +1335,12 @@ class AsyncResultTest(EngineFixture):
     @async_test
     async def test_scalars(self, async_engine, case):
         users = self.tables.users
+        stmt = select(users).order_by(users.c.user_id)
         async with async_engine.connect() as conn:
             if case == "scalars":
-                result = (await conn.scalars(select(users))).all()
+                result = (await conn.scalars(stmt)).all()
             elif case == "stream_scalars":
-                result = await (await conn.stream_scalars(select(users))).all()
+                result = await (await conn.stream_scalars(stmt)).all()
 
         eq_(result, list(range(1, 20)))
 
index 88c3b3a2540e947c0f3c411c61338cb00a549e38..5693ba7026065cd118bcd4c4ab322e0a3bee05ee 100644 (file)
@@ -629,8 +629,9 @@ class PickleTypesTest(fixtures.TestBase):
             proc = subprocess.run(
                 [sys.executable, "-c", code],
                 env={**os.environ, "PYTHONPATH": pythonpath},
+                stderr=subprocess.PIPE,
             )
-            eq_(proc.returncode, 0)
+            eq_(proc.returncode, 0, proc.stderr.decode(errors="replace"))
             os.unlink(name)
 
 
index d5b8f8834003b5d50e59fd516f1f215b029ab048..5ce0793ac69f0a9be44ccac0815feebf5a7b9cba 100644 (file)
@@ -193,35 +193,35 @@ first_stmt = select(str_col, int_col)
 second_stmt = select(str_col, int_col)
 third_stmt = select(int_col, str_col)
 
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(union(first_stmt, second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(union_all(first_stmt, second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(except_(first_stmt, second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(except_all(first_stmt, second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(intersect(first_stmt, second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(intersect_all(first_stmt, second_stmt))
 
-# EXPECTED_TYPE: Result[tuple[str, int]]
+# EXPECTED_TYPE: Result[Tuple[str, int]]
 reveal_type(Session().execute(union(first_stmt, second_stmt)))
-# EXPECTED_TYPE: Result[tuple[str, int]]
+# EXPECTED_TYPE: Result[Tuple[str, int]]
 reveal_type(Session().execute(union_all(first_stmt, second_stmt)))
 
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.union(second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.union_all(second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.except_(second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.except_all(second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.intersect(second_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.intersect_all(second_stmt))
 
 # TODO: the following do not error because _SelectStatementForCompoundArgument
@@ -243,15 +243,15 @@ reveal_type(intersect(first_stmt, third_stmt))
 # EXPECTED_TYPE: CompoundSelect[Never]
 reveal_type(intersect_all(first_stmt, third_stmt))
 
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.union(third_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.union_all(third_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.except_(third_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.except_all(third_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.intersect(third_stmt))
-# EXPECTED_TYPE: CompoundSelect[tuple[str, int]]
+# EXPECTED_TYPE: CompoundSelect[Tuple[str, int]]
 reveal_type(first_stmt.intersect_all(third_stmt))