Skip to content

Commit d56b0b7

Browse files
committedDec 4, 2020
black 20.8b1
1 parent d7b988a commit d56b0b7

File tree

5 files changed

+43
-35
lines changed

5 files changed

+43
-35
lines changed
 

‎MySQLdb/times.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ def Time_or_None(s):
131131

132132
def Date_or_None(s):
133133
try:
134-
return date(int(s[:4]), int(s[5:7]), int(s[8:10]),) # year # month # day
134+
return date(
135+
int(s[:4]),
136+
int(s[5:7]),
137+
int(s[8:10]),
138+
) # year # month # day
135139
except ValueError:
136140
return None
137141

‎tests/capabilities.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def new_table_name(self):
6868

6969
def create_table(self, columndefs):
7070

71-
""" Create a table using a list of column definitions given in
72-
columndefs.
71+
"""Create a table using a list of column definitions given in
72+
columndefs.
7373
74-
generator must be a function taking arguments (row_number,
75-
col_number) returning a suitable data object for insertion
76-
into the table.
74+
generator must be a function taking arguments (row_number,
75+
col_number) returning a suitable data object for insertion
76+
into the table.
7777
7878
"""
7979
self.table = self.new_table_name()

‎tests/configdb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
tests_path = path.dirname(__file__)
66
conf_file = environ.get("TESTDB", "default.cnf")
77
conf_path = path.join(tests_path, conf_file)
8-
connect_kwargs = dict(read_default_file=conf_path, read_default_group="MySQLdb-tests",)
8+
connect_kwargs = dict(
9+
read_default_file=conf_path,
10+
read_default_group="MySQLdb-tests",
11+
)
912

1013

1114
def connection_kwargs(kwargs):

‎tests/dbapi20.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@
6666

6767

6868
class DatabaseAPI20Test(unittest.TestCase):
69-
""" Test a database self.driver for DB API 2.0 compatibility.
70-
This implementation tests Gadfly, but the TestCase
71-
is structured so that other self.drivers can subclass this
72-
test case to ensure compiliance with the DB-API. It is
73-
expected that this TestCase may be expanded in the future
74-
if ambiguities or edge conditions are discovered.
69+
"""Test a database self.driver for DB API 2.0 compatibility.
70+
This implementation tests Gadfly, but the TestCase
71+
is structured so that other self.drivers can subclass this
72+
test case to ensure compiliance with the DB-API. It is
73+
expected that this TestCase may be expanded in the future
74+
if ambiguities or edge conditions are discovered.
7575
76-
The 'Optional Extensions' are not yet being tested.
76+
The 'Optional Extensions' are not yet being tested.
7777
78-
self.drivers should subclass this test, overriding setUp, tearDown,
79-
self.driver, connect_args and connect_kw_args. Class specification
80-
should be as follows:
78+
self.drivers should subclass this test, overriding setUp, tearDown,
79+
self.driver, connect_args and connect_kw_args. Class specification
80+
should be as follows:
8181
82-
import dbapi20
83-
class mytest(dbapi20.DatabaseAPI20Test):
84-
[...]
82+
import dbapi20
83+
class mytest(dbapi20.DatabaseAPI20Test):
84+
[...]
8585
86-
Don't 'import DatabaseAPI20Test from dbapi20', or you will
87-
confuse the unit tester - just 'import dbapi20'.
86+
Don't 'import DatabaseAPI20Test from dbapi20', or you will
87+
confuse the unit tester - just 'import dbapi20'.
8888
"""
8989

9090
# The self.driver module. This should be the module where the 'connect'
@@ -110,15 +110,15 @@ def executeDDL2(self, cursor):
110110
cursor.execute(self.ddl2)
111111

112112
def setUp(self):
113-
""" self.drivers should override this method to perform required setup
114-
if any is necessary, such as creating the database.
113+
"""self.drivers should override this method to perform required setup
114+
if any is necessary, such as creating the database.
115115
"""
116116
pass
117117

118118
def tearDown(self):
119-
""" self.drivers should override this method to perform required cleanup
120-
if any is necessary, such as deleting the test database.
121-
The default drops the tables that may be created.
119+
"""self.drivers should override this method to perform required cleanup
120+
if any is necessary, such as deleting the test database.
121+
The default drops the tables that may be created.
122122
"""
123123
con = self._connect()
124124
try:
@@ -521,8 +521,8 @@ def test_fetchone(self):
521521
]
522522

523523
def _populate(self):
524-
""" Return a list of sql commands to setup the DB for the fetch
525-
tests.
524+
"""Return a list of sql commands to setup the DB for the fetch
525+
tests.
526526
"""
527527
populate = [
528528
"insert into {}booze values ('{}')".format(self.table_prefix, s)
@@ -710,9 +710,9 @@ def test_mixedfetch(self):
710710
con.close()
711711

712712
def help_nextset_setUp(self, cur):
713-
""" Should create a procedure called deleteme
714-
that returns two result sets, first the
715-
number of rows in booze then "name from booze"
713+
"""Should create a procedure called deleteme
714+
that returns two result sets, first the
715+
number of rows in booze then "name from booze"
716716
"""
717717
raise NotImplementedError("Helper not implemented")
718718
# sql="""

‎tests/test_MySQLdb_dbapi20.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ def test_callproc(self):
161161
pass # performed in test_MySQL_capabilities
162162

163163
def help_nextset_setUp(self, cur):
164-
""" Should create a procedure called deleteme
165-
that returns two result sets, first the
166-
number of rows in booze then "name from booze"
164+
"""
165+
Should create a procedure called deleteme
166+
that returns two result sets, first the
167+
number of rows in booze then "name from booze"
167168
"""
168169
sql = """
169170
create procedure deleteme()

0 commit comments

Comments
 (0)
Please sign in to comment.