Skip to content

MySQL tests fail after multiple runs #50

@amoeba

Description

@amoeba

I noticed while running the tests locally that the MySQL tests started failing with an error (complete summary at the bottom):

MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")

I compared the setup blocks for MySQL and PostgreSQL and I see one difference is that the PostgreSQL block drops databases during setup while the MySQL block does not. @simonw do you test locally and have a setup that works for you? I'll submit a PR linked to this issue for how I worked around it.

Btw: I followed the README closely. I see that the tests on CI pass which I assume is because the databases are wiped on reach run.

Environment:

  • OS: macos (arm64)
  • Python: 3.11
  • db-to-sqlite version: v1.5 (b7c95fc)
pytest output summary
rs.PRIMARY'")
ERROR tests/test_docs.py::test_readme_contains_latest_help - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_fixtures.py::test_fixture_mysql - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_fixtures.py::test_fixture_postgresql - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[mysql://[email protected]:3306/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[postgresql://localhost/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[postgres://localhost/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
=========================================================== 19 errors in 0.13s ============================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions