Barry Warsaw pushed to branch issue255 at mailman / Mailman
Commits:
99671bec by Barry Warsaw at 2017-01-26T19:56:34-05:00
Enforce a stricter coding style.
- - - - -
ba08609f by Barry Warsaw at 2017-01-28T17:35:51+00:00
Merge branch 'brace-style' into 'master'
Enforce a stricter coding style
See merge request !237
- - - - -
91e99645 by Barry Warsaw at 2017-01-28T13:23:39-05:00
Merge branch 'master' into issue255.
- - - - -
6 changed files:
- src/mailman/database/tests/test_migrations.py
- src/mailman/rest/tests/test_addresses.py
- src/mailman/rest/tests/test_header_matches.py
- src/mailman/rest/users.py
- src/mailman/utilities/tests/test_import.py
- tox.ini
Changes:
=====================================
src/mailman/database/tests/test_migrations.py
=====================================
--- a/src/mailman/database/tests/test_migrations.py
+++ b/src/mailman/database/tests/test_migrations.py
@@ -135,9 +135,9 @@ class TestMigrations(unittest.TestCase):
for i in range(1, 6):
query = sa.sql.select(
[keyvalue_table.c.key, keyvalue_table.c.value]
- ).where(
- keyvalue_table.c.pended_id == i
- )
+ ).where(
+ keyvalue_table.c.pended_id == i
+ )
results[i] = dict([
(r['key'], r['value']) for r in
config.db.store.execute(query).fetchall()
=====================================
src/mailman/rest/tests/test_addresses.py
=====================================
--- a/src/mailman/rest/tests/test_addresses.py
+++ b/src/mailman/rest/tests/test_addresses.py
@@ -363,7 +363,7 @@ class TestAddresses(unittest.TestCase):
call_api(
'http://localhost:9001/3.0/addresses/[email protected]/user', {
'email': '[email protected]',
- })
+ })
self.assertEqual(cm.exception.code, 409)
def test_user_subresource_post_new_user_no_auto_create(self):
@@ -377,7 +377,7 @@ class TestAddresses(unittest.TestCase):
'http://localhost:9001/3.0/addresses/[email protected]/user', {
'display_name': 'Anne',
'auto_create': 0,
- })
+ })
self.assertEqual(cm.exception.code, 403)
def test_user_subresource_post_no_such_user(self):
=====================================
src/mailman/rest/tests/test_header_matches.py
=====================================
--- a/src/mailman/rest/tests/test_header_matches.py
+++ b/src/mailman/rest/tests/test_header_matches.py
@@ -60,7 +60,7 @@ class TestHeaderMatches(unittest.TestCase):
'/header-matches', {
'header': 'header',
'pattern': 'pattern',
- })
+ })
self.assertEqual(cm.exception.code, 400)
self.assertEqual(cm.exception.reason,
b'This header match already exists')
=====================================
src/mailman/rest/users.py
=====================================
--- a/src/mailman/rest/users.py
+++ b/src/mailman/rest/users.py
@@ -131,7 +131,7 @@ class _UserBase(CollectionMixin):
is_server_owner=user.is_server_owner,
self_link=self.api.path_to('users/{}'.format(user_id)),
user_id=user_id,
- )
+ )
# Add the password attribute, only if the user has a password. Same
# with the real name. These could be None or the empty string.
if user.password:
=====================================
src/mailman/utilities/tests/test_import.py
=====================================
--- a/src/mailman/utilities/tests/test_import.py
+++ b/src/mailman/utilities/tests/test_import.py
@@ -774,55 +774,55 @@ class TestRosterImport(unittest.TestCase):
'members': {
'[email protected]': 0,
'[email protected]': b'[email protected]',
- },
+ },
'digest_members': {
'[email protected]': 0,
'[email protected]': b'[email protected]',
- },
+ },
'passwords': {
'[email protected]': b'annepass',
'[email protected]': b'bobpass',
'[email protected]': b'cindypass',
'[email protected]': b'davepass',
- },
+ },
'language': {
'[email protected]': b'fr',
'[email protected]': b'de',
'[email protected]': b'es',
'[email protected]': b'it',
- },
+ },
# Usernames are unicode strings in the pickle
'usernames': {
'[email protected]': 'Anne',
'[email protected]': 'Bob',
'[email protected]': 'Cindy',
'[email protected]': 'Dave',
- },
+ },
'owner': [
'[email protected]',
'[email protected]',
- ],
+ ],
'moderator': [
'[email protected]',
'[email protected]',
- ],
+ ],
'accept_these_nonmembers': [
'[email protected]',
'^gene-.*@example.com',
- ],
+ ],
'hold_these_nonmembers': [
'[email protected]',
'^homer-.*@example.com',
- ],
+ ],
'reject_these_nonmembers': [
'[email protected]',
'^iris-.*@example.com',
- ],
+ ],
'discard_these_nonmembers': [
'[email protected]',
'^kenny-.*@example.com',
- ],
- }
+ ],
+ }
self._usermanager = getUtility(IUserManager)
language_manager = getUtility(ILanguageManager)
for code in self._pckdict['language'].values():
=====================================
tox.ini
=====================================
--- a/tox.ini
+++ b/tox.ini
@@ -51,7 +51,8 @@ rcfile = {toxinidir}/coverage.ini
rc = --rcfile={[coverage]rcfile}
[flake8]
-max-line-length = 79
+enable-extensions = U4
exclude = src/mailman/compat/*.py
+hang-closing = True
jobs = 1
-enable-extensions = U4
+max-line-length = 79
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/7c97e8fbdb90a1a0de1526d7a6f108e95415d6a0...91e99645ca80185a30a84744cef441bba96cf6a8
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org