Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

pymysql tests only work with pymysql<=1.0 #330

Closed

Description

@mweinelt

The utils module is gone.

ImportError while importing test module '/build/source/tests/test_connection_options.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/q6gfck5czr67090pwm53xrdyhpg6bx67-python3-3.8.9/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_connection_options.py:5: in <module>
    from databases.backends.mysql import MySQLBackend
/nix/store/y9k80z54dx8ykbzn4f9jwzzhh9sm45hl-python3.8-databases-0.2.6/lib/python3.8/site-packages/databases/backends/mysql.py:6: in <module>
    import aiomysql
/nix/store/v1vmdl62hh7d4rd9g6m6ibk34761dasc-python3.8-aiomysql-0.0.21/lib/python3.8/site-packages/aiomysql/__init__.py:32: in <module>
    from .connection import Connection, connect
/nix/store/v1vmdl62hh7d4rd9g6m6ibk34761dasc-python3.8-aiomysql-0.0.21/lib/python3.8/site-packages/aiomysql/connection.py:19: in <module>
    from pymysql.util import byte2int, int2byte
E   ModuleNotFoundError: No module named 'pymysql.util'

Activity

  1. aminalaee commented on Sep 12, 2021

    @aminalaee
    Contributor

    @mweinelt You're right. But aiomysql requires pymysql <= 1.0. How did you install that?

  2. gordthompson commented on Oct 28, 2021

    @gordthompson

    I suggest switching from aiomysql to asyncmy for MySQL support. As noted in the SQLAlchemy documentation:

    WARNING

    The aiomysql dialect is not currently tested as part of SQLAlchemy’s continuous integration. As of September, 2021 the driver appears to be unmaintained and no longer functions for Python version 3.10, and additionally depends on a significantly outdated version of PyMySQL. Please refer to the asyncmy dialect for current MySQL/MariaDB asyncio functionality.

    @aminalaee - If you would like me to try and put together a PR to replace aiomysql with asyncmy just let me know.

  3. aminalaee commented on Oct 28, 2021

    @aminalaee
    Contributor

    @gordthompson Thank you.
    I've already created a PR #382 for that.
    Feel free to review that.

    Probably in the future we have to omit aiomysql too.

  4. aminalaee commented on Nov 24, 2021

    @aminalaee
    Contributor

    We can close this for now, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions