Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Jun 27, 2021
1 parent 6ccbecc commit fb10477
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions pymysql/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class TestConversion(base.PyMySQLTestCase):
def test_datatypes(self):
""" test every data type """
"""test every data type"""
conn = self.connect()
c = conn.cursor()
c.execute(
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_datatypes(self):
c.execute("drop table test_datatypes")

def test_dict(self):
""" test dict escaping """
"""test dict escaping"""
conn = self.connect()
c = conn.cursor()
c.execute("create table test_dict (a integer, b integer, c integer)")
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_blob(self):
self.assertEqual(data, c.fetchone()[0])

def test_untyped(self):
""" test conversion of null, empty string """
"""test conversion of null, empty string"""
conn = self.connect()
c = conn.cursor()
c.execute("select null,''")
Expand All @@ -152,7 +152,7 @@ def test_untyped(self):
self.assertEqual(("", None), c.fetchone())

def test_timedelta(self):
""" test timedelta conversion """
"""test timedelta conversion"""
conn = self.connect()
c = conn.cursor()
c.execute(
Expand All @@ -172,7 +172,7 @@ def test_timedelta(self):
)

def test_datetime_microseconds(self):
""" test datetime conversion w microseconds"""
"""test datetime conversion w microseconds"""

conn = self.connect()
if not self.mysql_server_is(conn, (5, 6, 4)):
Expand Down Expand Up @@ -243,7 +243,7 @@ class TestCursor(base.PyMySQLTestCase):
# self.assertEqual(r, c.description)

def test_fetch_no_result(self):
""" test a fetchone() with no rows """
"""test a fetchone() with no rows"""
conn = self.connect()
c = conn.cursor()
c.execute("create table test_nr (b varchar(32))")
Expand All @@ -255,7 +255,7 @@ def test_fetch_no_result(self):
c.execute("drop table test_nr")

def test_aggregates(self):
""" test aggregate functions """
"""test aggregate functions"""
conn = self.connect()
c = conn.cursor()
try:
Expand All @@ -269,7 +269,7 @@ def test_aggregates(self):
c.execute("drop table test_aggregates")

def test_single_tuple(self):
""" test a single tuple """
"""test a single tuple"""
conn = self.connect()
c = conn.cursor()
self.safe_create_table(
Expand Down
18 changes: 9 additions & 9 deletions pymysql/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def realTestDialogAuthTwoQuestions(self):
pymysql.connect(
user="pymysql_2q",
auth_plugin_map={b"dialog": TestAuthentication.Dialog},
**self.db
**self.db,
)

@pytest.mark.skipif(not socket_auth, reason="connection to unix_socket required")
Expand Down Expand Up @@ -266,12 +266,12 @@ def realTestDialogAuthThreeAttempts(self):
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"dialog": TestAuthentication.Dialog},
**self.db
**self.db,
)
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"dialog": TestAuthentication.DialogHandler},
**self.db
**self.db,
)
with self.assertRaises(pymysql.err.OperationalError):
pymysql.connect(
Expand All @@ -282,27 +282,27 @@ def realTestDialogAuthThreeAttempts(self):
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"dialog": TestAuthentication.DefectiveHandler},
**self.db
**self.db,
)
with self.assertRaises(pymysql.err.OperationalError):
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"notdialogplugin": TestAuthentication.Dialog},
**self.db
**self.db,
)
TestAuthentication.Dialog.m = {b"Password, please:": b"I do not know"}
with self.assertRaises(pymysql.err.OperationalError):
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"dialog": TestAuthentication.Dialog},
**self.db
**self.db,
)
TestAuthentication.Dialog.m = {b"Password, please:": None}
with self.assertRaises(pymysql.err.OperationalError):
pymysql.connect(
user="pymysql_3a",
auth_plugin_map={b"dialog": TestAuthentication.Dialog},
**self.db
**self.db,
)

@pytest.mark.skipif(not socket_auth, reason="connection to unix_socket required")
Expand Down Expand Up @@ -367,7 +367,7 @@ def realTestPamAuth(self):
auth_plugin_map={
b"mysql_cleartext_password": TestAuthentication.DefectiveHandler
},
**self.db
**self.db,
)
except pymysql.OperationalError as e:
self.assertEqual(1045, e.args[0])
Expand All @@ -378,7 +378,7 @@ def realTestPamAuth(self):
auth_plugin_map={
b"mysql_cleartext_password": TestAuthentication.DefectiveHandler
},
**self.db
**self.db,
)
if grants:
# recreate the user
Expand Down
32 changes: 16 additions & 16 deletions pymysql/tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class TestOldIssues(base.PyMySQLTestCase):
def test_issue_3(self):
""" undefined methods datetime_or_None, date_or_None """
"""undefined methods datetime_or_None, date_or_None"""
conn = self.connect()
c = conn.cursor()
with warnings.catch_warnings():
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_issue_3(self):
c.execute("drop table issue3")

def test_issue_4(self):
""" can't retrieve TIMESTAMP fields """
"""can't retrieve TIMESTAMP fields"""
conn = self.connect()
c = conn.cursor()
with warnings.catch_warnings():
Expand All @@ -57,13 +57,13 @@ def test_issue_4(self):
c.execute("drop table issue4")

def test_issue_5(self):
""" query on information_schema.tables fails """
"""query on information_schema.tables fails"""
con = self.connect()
cur = con.cursor()
cur.execute("select * from information_schema.tables")

def test_issue_6(self):
""" exception: TypeError: ord() expected a character, but string of length 0 found """
"""exception: TypeError: ord() expected a character, but string of length 0 found"""
# ToDo: this test requires access to db 'mysql'.
kwargs = self.databases[0].copy()
kwargs["database"] = "mysql"
Expand All @@ -73,7 +73,7 @@ def test_issue_6(self):
conn.close()

def test_issue_8(self):
""" Primary Key and Index error when selecting data """
"""Primary Key and Index error when selecting data"""
conn = self.connect()
c = conn.cursor()
with warnings.catch_warnings():
Expand All @@ -93,7 +93,7 @@ def test_issue_8(self):
c.execute("drop table test")

def test_issue_13(self):
""" can't handle large result fields """
"""can't handle large result fields"""
conn = self.connect()
cur = conn.cursor()
with warnings.catch_warnings():
Expand All @@ -112,7 +112,7 @@ def test_issue_13(self):
cur.execute("drop table issue13")

def test_issue_15(self):
""" query should be expanded before perform character encoding """
"""query should be expanded before perform character encoding"""
conn = self.connect()
c = conn.cursor()
with warnings.catch_warnings():
Expand All @@ -127,7 +127,7 @@ def test_issue_15(self):
c.execute("drop table issue15")

def test_issue_16(self):
""" Patch for string and tuple escaping """
"""Patch for string and tuple escaping"""
conn = self.connect()
c = conn.cursor()
with warnings.catch_warnings():
Expand Down Expand Up @@ -285,7 +285,7 @@ def disabled_test_issue_54(self):

class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_66(self):
""" 'Connection' object has no attribute 'insert_id' """
"""'Connection' object has no attribute 'insert_id'"""
conn = self.connect()
c = conn.cursor()
self.assertEqual(0, conn.insert_id())
Expand All @@ -303,7 +303,7 @@ def test_issue_66(self):
c.execute("drop table issue66")

def test_issue_79(self):
""" Duplicate field overwrites the previous one in the result of DictCursor """
"""Duplicate field overwrites the previous one in the result of DictCursor"""
conn = self.connect()
c = conn.cursor(pymysql.cursors.DictCursor)

Expand All @@ -330,7 +330,7 @@ def test_issue_79(self):
c.execute("drop table b")

def test_issue_95(self):
""" Leftover trailing OK packet for "CALL my_sp" queries """
"""Leftover trailing OK packet for "CALL my_sp" queries"""
conn = self.connect()
cur = conn.cursor()
with warnings.catch_warnings():
Expand All @@ -352,7 +352,7 @@ def test_issue_95(self):
cur.execute("DROP PROCEDURE IF EXISTS `foo`")

def test_issue_114(self):
""" autocommit is not set after reconnecting with ping() """
"""autocommit is not set after reconnecting with ping()"""
conn = pymysql.connect(charset="utf8", **self.databases[0])
conn.autocommit(False)
c = conn.cursor()
Expand All @@ -377,7 +377,7 @@ def test_issue_114(self):
conn.close()

def test_issue_175(self):
""" The number of fields returned by server is read in wrong way """
"""The number of fields returned by server is read in wrong way"""
conn = self.connect()
cur = conn.cursor()
for length in (200, 300):
Expand All @@ -393,7 +393,7 @@ def test_issue_175(self):
cur.execute("drop table if exists test_field_count")

def test_issue_321(self):
""" Test iterable as query argument. """
"""Test iterable as query argument."""
conn = pymysql.connect(charset="utf8", **self.databases[0])
self.safe_create_table(
conn,
Expand Down Expand Up @@ -422,7 +422,7 @@ def test_issue_321(self):
self.assertEqual(cur.fetchone(), ("c", "\u0430"))

def test_issue_364(self):
""" Test mixed unicode/binary arguments in executemany. """
"""Test mixed unicode/binary arguments in executemany."""
conn = pymysql.connect(charset="utf8mb4", **self.databases[0])
self.safe_create_table(
conn,
Expand Down Expand Up @@ -454,7 +454,7 @@ def test_issue_364(self):
cur.executemany(usql, args=(values, values, values))

def test_issue_363(self):
""" Test binary / geometry types. """
"""Test binary / geometry types."""
conn = pymysql.connect(charset="utf8", **self.databases[0])
self.safe_create_table(
conn,
Expand Down

0 comments on commit fb10477

Please sign in to comment.