From f3cdad3597921ac8aecd3c67e564cf999c1e1373 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Wed, 5 Mar 2025 19:28:30 +0100 Subject: [PATCH] test related fixes 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 | 41 ------------------- test/ext/asyncio/test_engine_py3k.py | 5 ++- test/sql/test_types.py | 3 +- .../plain_files/sql/common_sql_element.py | 40 +++++++++--------- 4 files changed, 25 insertions(+), 64 deletions(-) diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index b4dea776f0..6c93ef1b4f 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -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 }} diff --git a/test/ext/asyncio/test_engine_py3k.py b/test/ext/asyncio/test_engine_py3k.py index 6be408ecae..231d32cbe1 100644 --- a/test/ext/asyncio/test_engine_py3k.py +++ b/test/ext/asyncio/test_engine_py3k.py @@ -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))) diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 88c3b3a254..5693ba7026 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -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) diff --git a/test/typing/plain_files/sql/common_sql_element.py b/test/typing/plain_files/sql/common_sql_element.py index d5b8f88340..5ce0793ac6 100644 --- a/test/typing/plain_files/sql/common_sql_element.py +++ b/test/typing/plain_files/sql/common_sql_element.py @@ -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)) -- 2.47.3