black 20.8b1

This commit is contained in:
Inada Naoki
2020-12-04 12:21:41 +09:00
parent d7b988ae16
commit d56b0b7f8c
5 changed files with 43 additions and 35 deletions

View File

@ -131,7 +131,11 @@ def Time_or_None(s):
def Date_or_None(s):
try:
return date(int(s[:4]), int(s[5:7]), int(s[8:10]),) # year # month # day
return date(
int(s[:4]),
int(s[5:7]),
int(s[8:10]),
) # year # month # day
except ValueError:
return None

View File

@ -68,7 +68,7 @@ class DatabaseTest(unittest.TestCase):
def create_table(self, columndefs):
""" Create a table using a list of column definitions given in
"""Create a table using a list of column definitions given in
columndefs.
generator must be a function taking arguments (row_number,

View File

@ -5,7 +5,10 @@ from os import environ, path
tests_path = path.dirname(__file__)
conf_file = environ.get("TESTDB", "default.cnf")
conf_path = path.join(tests_path, conf_file)
connect_kwargs = dict(read_default_file=conf_path, read_default_group="MySQLdb-tests",)
connect_kwargs = dict(
read_default_file=conf_path,
read_default_group="MySQLdb-tests",
)
def connection_kwargs(kwargs):

View File

@ -66,7 +66,7 @@ import time
class DatabaseAPI20Test(unittest.TestCase):
""" Test a database self.driver for DB API 2.0 compatibility.
"""Test a database self.driver for DB API 2.0 compatibility.
This implementation tests Gadfly, but the TestCase
is structured so that other self.drivers can subclass this
test case to ensure compiliance with the DB-API. It is
@ -110,13 +110,13 @@ class DatabaseAPI20Test(unittest.TestCase):
cursor.execute(self.ddl2)
def setUp(self):
""" self.drivers should override this method to perform required setup
"""self.drivers should override this method to perform required setup
if any is necessary, such as creating the database.
"""
pass
def tearDown(self):
""" self.drivers should override this method to perform required cleanup
"""self.drivers should override this method to perform required cleanup
if any is necessary, such as deleting the test database.
The default drops the tables that may be created.
"""
@ -521,7 +521,7 @@ class DatabaseAPI20Test(unittest.TestCase):
]
def _populate(self):
""" Return a list of sql commands to setup the DB for the fetch
"""Return a list of sql commands to setup the DB for the fetch
tests.
"""
populate = [
@ -710,7 +710,7 @@ class DatabaseAPI20Test(unittest.TestCase):
con.close()
def help_nextset_setUp(self, cur):
""" Should create a procedure called deleteme
"""Should create a procedure called deleteme
that returns two result sets, first the
number of rows in booze then "name from booze"
"""

View File

@ -161,7 +161,8 @@ class test_MySQLdb(dbapi20.DatabaseAPI20Test):
pass # performed in test_MySQL_capabilities
def help_nextset_setUp(self, cur):
""" Should create a procedure called deleteme
"""
Should create a procedure called deleteme
that returns two result sets, first the
number of rows in booze then "name from booze"
"""