aio-libs / aiomysql

aiomysql is a library for accessing a MySQL database from the asyncio
https://aiomysql.rtfd.io
MIT License
1.74k stars 255 forks source link

Partially port PyMySQL#304 #839

Closed Nothing4You closed 2 years ago

Nothing4You commented 2 years ago

What do these changes do?

Partially port https://github.com/PyMySQL/PyMySQL/pull/304

Are there changes in behavior for the user?

aiomysql now reraises the original exception during connect() if it's not IOError, OSError or asyncio.TimeoutError. This was previously always raised as OperationalError.

asyncio.TimeoutError is a deprecated alias of OSError as of python 3.11, for consistency we already include here, so the exception handling won't differ across python versions.

Related issue number

fixes #792

Checklist

codecov[bot] commented 2 years ago

Codecov Report

Merging #839 (780420b) into master (a09398f) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #839      +/-   ##
==========================================
+ Coverage   93.61%   93.66%   +0.04%     
==========================================
  Files          36       36              
  Lines        5499     5507       +8     
  Branches      928      931       +3     
==========================================
+ Hits         5148     5158      +10     
+ Misses        263      262       -1     
+ Partials       88       87       -1     
Flag Coverage Δ
ubuntu-latest_3.10_mariadb-10.3 90.17% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mariadb-10.4 90.17% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mariadb-10.5 90.15% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mariadb-10.6 90.15% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mariadb-10.7 90.15% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mariadb-10.8 90.15% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.10_mysql-5.7 90.86% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.10_mysql-8.0 92.26% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.3 90.13% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.4 90.13% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.5 90.12% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.6 90.12% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.7 90.12% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mariadb-10.8 90.12% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.11-dev_mysql-5.7 90.82% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.11-dev_mysql-8.0 92.22% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.3 89.62% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.4 89.62% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.5 89.60% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.6 89.60% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.7 89.60% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mariadb-10.8 89.60% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mysql-5.7 90.35% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.7_mysql-8.0 91.84% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.3 90.21% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.4 90.21% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.5 90.20% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.6 90.20% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.7 90.20% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mariadb-10.8 90.20% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.8_mysql-5.7 90.90% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.8_mysql-8.0 92.29% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.3 90.07% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.4 90.07% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.5 90.05% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.6 90.05% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.7 90.05% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mariadb-10.8 90.05% <100.00%> (+0.05%) :arrow_up:
ubuntu-latest_3.9_mysql-5.7 90.76% <100.00%> (+0.04%) :arrow_up:
ubuntu-latest_3.9_mysql-8.0 92.14% <100.00%> (+0.04%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tests/test_connection.py 100.00% <ø> (ø)
aiomysql/connection.py 84.26% <100.00%> (+0.27%) :arrow_up:
tests/test_issues.py 85.93% <100.00%> (+0.26%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more