Source: yoyo
Version: 7.3.2+dfsg1-5
Severity: serious
User: debian...@lists.debian.org
Usertags: needs-update
User: debian-pyt...@lists.debian.org
Usertags: python3.11
Control: affects -1 src:python3-defaults

Hi Maintainer

The autopkgtests of yoyo fail with Python 3.11 as the default version
(and Python 3.10 still supported) [1].  I've copied what I hope is the
relevant part of the log below.

Regards
Graham


[1] https://ci.debian.net/packages/y/yoyo/testing/amd64/


Creating new PostgreSQL cluster 15/regress ...
Warning: connection to the database failed, disabling startup checks:
psql: error: connection to server on socket "/tmp/.s.PGSQL.5433"
failed: FATAL:  role "debci" does not exist

+ export 
PYTHONPATH=/tmp/autopkgtest-lxc.z8fl1tkb/downtmp/build.X7w/src/debian/tests
+ PYTHONPATH=/tmp/autopkgtest-lxc.z8fl1tkb/downtmp/build.X7w/src/debian/tests
+ psql -Upostgres -c 'create database yoyo_test;'
CREATE DATABASE
+ pytest-3 yoyo/tests
============================= test session starts ==============================
platform linux -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0+repack
rootdir: /tmp/autopkgtest-lxc.z8fl1tkb/downtmp/build.X7w/src
collected 152 items

yoyo/tests/test_backends.py ......ss......s.s......                      [ 15%]
yoyo/tests/test_cli_script.py ..............s.s......................... [ 42%]
.                                                                        [ 43%]
yoyo/tests/test_config.py ...............                                [ 53%]
yoyo/tests/test_connections.py ........                                  [ 58%]
yoyo/tests/test_internalmigrations.py ........                           [ 63%]
yoyo/tests/test_migrations.py .......................................... [ 91%]
..FF....                                                                 [ 96%]
yoyo/tests/test_utils.py .....                                           [100%]

=================================== FAILURES ===================================
__________ TestPostApplyHooks.test_it_runs_multiple_post_apply_hooks ___________

self = <yoyo.tests.test_migrations.TestPostApplyHooks object at 0x7fc68367c190>
backend_sqlite3 = <yoyo.backends.SQLiteBackend object at 0x7fc6836a4dd0>

    def test_it_runs_multiple_post_apply_hooks(self, backend_sqlite3):
        with migrations_dir(
            **{
                "a": "step('create table postapply (i int)')",
                "post-apply": "step('insert into postapply values (1)')",
                "post-apply2": "step('insert into postapply values (2)')",
            }
        ) as tmpdir:
>           backend_sqlite3.apply_migrations(
                backend_sqlite3.to_apply(read_migrations(tmpdir))
            )

yoyo/tests/test_migrations.py:611:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
yoyo/backends.py:449: in apply_migrations
    self.apply_migrations_only(migrations, force=force)
yoyo/backends.py:461: in apply_migrations_only
    self.apply_one(m, force=force)
yoyo/backends.py:507: in apply_one
    migration.process_steps(migration_backend, "apply", force=force)
yoyo/migrations.py:272: in process_steps
    raise exc_info[1].with_traceback(exc_info[2])
yoyo/migrations.py:257: in process_steps
    getattr(step, direction)(backend, force)
yoyo/migrations.py:315: in apply
    getattr(self.step, direction)(backend, force)
yoyo/migrations.py:411: in apply
    self._execute(cursor, self._apply)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MigrationStep #0>, cursor = <sqlite3.Cursor object at 0x7fc683661740>
stmt = 'create table postapply (i int)'
out = <_io.TextIOWrapper name="<_io.FileIO name=6 mode='rb+'
closefd=True>" mode='r+' encoding='utf-8'>

    def _execute(self, cursor, stmt, out=None):
        """
        Execute the given statement. If rows are returned, output these in a
        tabulated format.
        """
        if out is None:
            out = sys.stdout
        if isinstance(stmt, str):
            logger.debug(" - executing %r", stmt.encode("ascii", "replace"))
        else:
            logger.debug(" - executing %r", stmt)
>       cursor.execute(stmt)
E       sqlite3.OperationalError: table postapply already exists

yoyo/migrations.py:381: OperationalError
_______ TestPostApplyHooks.test_apply_migrations_only_does_not_run_hooks _______

self = <yoyo.tests.test_migrations.TestPostApplyHooks object at 0x7fc68369abd0>
backend_sqlite3 = <yoyo.backends.SQLiteBackend object at 0x7fc6833dcf50>

    def test_apply_migrations_only_does_not_run_hooks(self, backend_sqlite3):
        with migrations_dir(
            **{
                "a": "step('create table postapply (i int)')",
                "post-apply": "step('insert into postapply values (1)')",
            }
        ) as tmpdir:
>           backend_sqlite3.apply_migrations_only(
                backend_sqlite3.to_apply(read_migrations(tmpdir))
            )

yoyo/tests/test_migrations.py:625:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
yoyo/backends.py:461: in apply_migrations_only
    self.apply_one(m, force=force)
yoyo/backends.py:507: in apply_one
    migration.process_steps(migration_backend, "apply", force=force)
yoyo/migrations.py:272: in process_steps
    raise exc_info[1].with_traceback(exc_info[2])
yoyo/migrations.py:257: in process_steps
    getattr(step, direction)(backend, force)
yoyo/migrations.py:315: in apply
    getattr(self.step, direction)(backend, force)
yoyo/migrations.py:411: in apply
    self._execute(cursor, self._apply)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MigrationStep #0>, cursor = <sqlite3.Cursor object at 0x7fc683667740>
stmt = 'create table postapply (i int)'
out = <_io.TextIOWrapper name="<_io.FileIO name=6 mode='rb+'
closefd=True>" mode='r+' encoding='utf-8'>

    def _execute(self, cursor, stmt, out=None):
        """
        Execute the given statement. If rows are returned, output these in a
        tabulated format.
        """
        if out is None:
            out = sys.stdout
        if isinstance(stmt, str):
            logger.debug(" - executing %r", stmt.encode("ascii", "replace"))
        else:
            logger.debug(" - executing %r", stmt)
>       cursor.execute(stmt)
E       sqlite3.OperationalError: table postapply already exists

yoyo/migrations.py:381: OperationalError

Reply via email to