Skip to content

Commit e3c1bb8

Browse files
authored
chore(flake8): fixed flake8 errors (#484)
1 parent e4762d9 commit e3c1bb8

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

aiomysql/sa/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def execute(self, query, *multiparams, **params):
4949
)
5050
5151
In the case that a plain SQL string is passed, a tuple or
52-
individual values in \*multiparams may be passed::
52+
individual values in *multiparams may be passed::
5353
5454
await conn.execute(
5555
"INSERT INTO table (id, value) VALUES (%d, %s)",

examples/example_oldstyle.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77

88
@asyncio.coroutine
99
def test_example():
10-
conn = yield from aiomysql.connect(host='127.0.0.1', port=3306,
11-
user='root', password='', db='mysql',
12-
loop=loop)
10+
conn = yield from aiomysql.connect(
11+
host='127.0.0.1',
12+
port=3306,
13+
user='root',
14+
password='',
15+
db='mysql',
16+
loop=loop
17+
)
1318

1419
cur = yield from conn.cursor()
1520
yield from cur.execute("SELECT Host,User FROM user")

examples/example_pool_oldstyle.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77

88
@asyncio.coroutine
99
def test_example():
10-
pool = yield from aiomysql.create_pool(host='127.0.0.1', port=3306,
11-
user='root', password='',
12-
db='mysql', loop=loop)
13-
with (yield from pool) as conn:
14-
cur = yield from conn.cursor()
15-
yield from cur.execute("SELECT 10")
16-
# print(cur.description)
17-
(r,) = yield from cur.fetchone()
18-
assert r == 10
19-
pool.close()
20-
yield from pool.wait_closed()
10+
pool = yield from aiomysql.create_pool(
11+
host='127.0.0.1',
12+
port=3306,
13+
user='root',
14+
password='',
15+
db='mysql',
16+
loop=loop
17+
)
18+
with (yield from pool) as conn:
19+
cur = yield from conn.cursor()
20+
yield from cur.execute("SELECT 10")
21+
# print(cur.description)
22+
(r,) = yield from cur.fetchone()
23+
assert r == 10
24+
pool.close()
25+
yield from pool.wait_closed()
2126

2227

2328
loop.run_until_complete(test_example())

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def mysql_server(unused_port, docker, session_id,
329329
cursor.execute('FLUSH PRIVILEGES')
330330

331331
break
332-
except Exception as err:
332+
except Exception:
333333
time.sleep(delay)
334334
delay *= 2
335335
else:

0 commit comments

Comments
 (0)