Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.

This commit is contained in:
Jon Dufresne 2017-06-01 16:08:59 -07:00 committed by Tim Graham
parent edee5a8de6
commit 2c69824e5a
63 changed files with 145 additions and 150 deletions

View file

@ -91,19 +91,19 @@ class PostgreSQLDatabaseCreationTests(SimpleTestCase):
self.assertEqual(suffix, expected)
def test_sql_table_creation_suffix_with_none_settings(self):
settings = dict(CHARSET=None, TEMPLATE=None)
settings = {'CHARSET': None, 'TEMPLATE': None}
self.check_sql_table_creation_suffix(settings, "")
def test_sql_table_creation_suffix_with_encoding(self):
settings = dict(CHARSET='UTF8')
settings = {'CHARSET': 'UTF8'}
self.check_sql_table_creation_suffix(settings, "WITH ENCODING 'UTF8'")
def test_sql_table_creation_suffix_with_template(self):
settings = dict(TEMPLATE='template0')
settings = {'TEMPLATE': 'template0'}
self.check_sql_table_creation_suffix(settings, 'WITH TEMPLATE "template0"')
def test_sql_table_creation_suffix_with_encoding_and_template(self):
settings = dict(CHARSET='UTF8', TEMPLATE='template0')
settings = {'CHARSET': 'UTF8', 'TEMPLATE': 'template0'}
self.check_sql_table_creation_suffix(settings, '''WITH ENCODING 'UTF8' TEMPLATE "template0"''')
def _execute_raise_database_already_exists(self, cursor, parameters, keepdb=False):

View file

@ -970,9 +970,7 @@ class ThreadTests(TransactionTestCase):
t.start()
t.join()
# Each created connection got different inner connection.
self.assertEqual(
len(set(conn.connection for conn in connections_dict.values())),
3)
self.assertEqual(len({conn.connection for conn in connections_dict.values()}), 3)
# Finish by closing the connections opened by the other threads (the
# connection opened in the main thread will automatically be closed on
# teardown).