Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flake8 errors #484

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aiomysql/sa/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def execute(self, query, *multiparams, **params):
)

In the case that a plain SQL string is passed, a tuple or
individual values in \*multiparams may be passed::
individual values in *multiparams may be passed::

await conn.execute(
"INSERT INTO table (id, value) VALUES (%d, %s)",
Expand Down
11 changes: 8 additions & 3 deletions examples/example_oldstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@

@asyncio.coroutine
def test_example():
conn = yield from aiomysql.connect(host='127.0.0.1', port=3306,
user='root', password='', db='mysql',
loop=loop)
conn = yield from aiomysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password='',
db='mysql',
loop=loop
)

cur = yield from conn.cursor()
yield from cur.execute("SELECT Host,User FROM user")
Expand Down
27 changes: 16 additions & 11 deletions examples/example_pool_oldstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@

@asyncio.coroutine
def test_example():
pool = yield from aiomysql.create_pool(host='127.0.0.1', port=3306,
user='root', password='',
db='mysql', loop=loop)
with (yield from pool) as conn:
cur = yield from conn.cursor()
yield from cur.execute("SELECT 10")
# print(cur.description)
(r,) = yield from cur.fetchone()
assert r == 10
pool.close()
yield from pool.wait_closed()
pool = yield from aiomysql.create_pool(
host='127.0.0.1',
port=3306,
user='root',
password='',
db='mysql',
loop=loop
)
with (yield from pool) as conn:
cur = yield from conn.cursor()
yield from cur.execute("SELECT 10")
# print(cur.description)
(r,) = yield from cur.fetchone()
assert r == 10
pool.close()
yield from pool.wait_closed()


loop.run_until_complete(test_example())
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def mysql_server(unused_port, docker, session_id,
cursor.execute('FLUSH PRIVILEGES')

break
except Exception as err:
except Exception:
time.sleep(delay)
delay *= 2
else:
Expand Down