fix(ci): fix ruff lint errors and postgres legacy migration table exclusion

This commit is contained in:
BiFangKNT
2026-09-12 15:35:47 +08:00
parent 9db6650274
commit dfde9578c1
5 changed files with 12 additions and 21 deletions
@@ -8,14 +8,10 @@ from unittest.mock import AsyncMock, Mock
import pytest
from tests.integration.api.test_smoke import (
fake_api_app,
mock_circular_import_chain,
quart_test_client,
)
pytest_plugins = ['tests.integration.api.test_smoke']
pytestmark = [pytest.mark.integration, pytest.mark.usefixtures('mock_circular_import_chain')]
pytestmark = pytest.mark.integration
class TestPasskeyPublicEndpoints:
@@ -550,11 +550,13 @@ class TestPostgreSQLWorkspaceMigration:
)
assert 'workspaces' not in tables_before_migration
assert 'codex_credentials' not in tables_before_migration
assert 'passkey_credentials' not in tables_before_migration
await manager._initialize_managed_schema()
async with postgres_engine.connect() as conn:
assert 'codex_credentials' in await conn.run_sync(lambda sync: sa.inspect(sync).get_table_names())
assert 'passkey_credentials' in await conn.run_sync(lambda sync: sa.inspect(sync).get_table_names())
account = (await conn.execute(text('SELECT uuid, status, source FROM users'))).mappings().one()
workspace = (
(await conn.execute(text('SELECT * FROM workspaces WHERE source = :source'), {'source': 'local'}))