diff --git a/tools/test-backend b/tools/test-backend index a466c5258d..7d27b539cf 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -256,9 +256,7 @@ def main() -> None: parser.add_argument( "--rerun", action="store_true", - help=( - "Run the tests which failed the last time " "test-backend was run. Implies not --stop." - ), + help="Run the tests which failed the last time test-backend was run. Implies not --stop.", ) parser.add_argument( "--include-webhooks", diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py index 1e2fa16529..7938ad8c7f 100644 --- a/zerver/lib/markdown/__init__.py +++ b/zerver/lib/markdown/__init__.py @@ -1694,7 +1694,7 @@ class BlockQuoteProcessor(markdown.blockprocessors.BlockQuoteProcessor): """ # Original regex for blockquote is RE = re.compile(r'(^|\n)[ ]{0,3}>[ ]?(.*)') - RE = re.compile(r"(^|\n)(?!(?:[ ]{0,3}>\s*(?:$|\n))*(?:$|\n))" r"[ ]{0,3}>[ ]?(.*)") + RE = re.compile(r"(^|\n)(?!(?:[ ]{0,3}>\s*(?:$|\n))*(?:$|\n))[ ]{0,3}>[ ]?(.*)") # run() is very slightly forked from the base class; see notes below. def run(self, parent: Element, blocks: List[str]) -> None: diff --git a/zerver/management/commands/get_migration_status.py b/zerver/management/commands/get_migration_status.py index f1fe98a764..d8ee7fb7fd 100644 --- a/zerver/management/commands/get_migration_status.py +++ b/zerver/management/commands/get_migration_status.py @@ -20,7 +20,7 @@ class Command(BaseCommand): parser.add_argument( "--database", default=DEFAULT_DB_ALIAS, - help="Nominates a database to synchronize. " 'Defaults to the "default" database.', + help='Nominates a database to synchronize. Defaults to the "default" database.', ) parser.add_argument("--output", help="Path to store the status to (default to stdout).") diff --git a/zerver/management/commands/send_webhook_fixture_message.py b/zerver/management/commands/send_webhook_fixture_message.py index 7b3d8b0e6c..609b648373 100644 --- a/zerver/management/commands/send_webhook_fixture_message.py +++ b/zerver/management/commands/send_webhook_fixture_message.py @@ -32,7 +32,7 @@ approach shown above. def add_arguments(self, parser: CommandParser) -> None: parser.add_argument( - "-f", "--fixture", help="The path to the fixture you'd like to send " "into Zulip" + "-f", "--fixture", help="The path to the fixture you'd like to send into Zulip" ) parser.add_argument( diff --git a/zerver/tests/test_link_embed.py b/zerver/tests/test_link_embed.py index daa00d3de4..8c19e3d82f 100644 --- a/zerver/tests/test_link_embed.py +++ b/zerver/tests/test_link_embed.py @@ -683,7 +683,7 @@ class PreviewTestCase(ZulipTestCase): self.assertIsNone(cached_data) msg = Message.objects.select_related("sender").get(id=msg_id) self.assertEqual( - ('
"), + '', msg.rendered_content, ) @@ -719,7 +719,7 @@ class PreviewTestCase(ZulipTestCase): self.assertIsNone(cached_data.image) msg = Message.objects.select_related("sender").get(id=msg_id) self.assertEqual( - ('"), + '', msg.rendered_content, ) @@ -758,7 +758,7 @@ class PreviewTestCase(ZulipTestCase): self.assertIsNone(cached_data.image) msg = Message.objects.select_related("sender").get(id=msg_id) self.assertEqual( - ('"), + '', msg.rendered_content, ) @@ -795,7 +795,7 @@ class PreviewTestCase(ZulipTestCase): self.assertIsNone(cached_data.image) msg = Message.objects.select_related("sender").get(id=msg_id) self.assertEqual( - ('"), + '', msg.rendered_content, ) diff --git a/zerver/tests/test_markdown.py b/zerver/tests/test_markdown.py index 542b5195c7..66b5981733 100644 --- a/zerver/tests/test_markdown.py +++ b/zerver/tests/test_markdown.py @@ -2027,7 +2027,7 @@ class MarkdownTest(ZulipTestCase): rendering_result = render_markdown(msg, content) self.assertEqual( rendering_result.rendered_content, - '' "@all" " test
", + '@all test
', ) self.assertTrue(rendering_result.mentions_wildcard) @@ -2039,7 +2039,7 @@ class MarkdownTest(ZulipTestCase): rendering_result = render_markdown(msg, content) self.assertEqual( rendering_result.rendered_content, - '' "@everyone" " test
", + '@everyone test
', ) self.assertTrue(rendering_result.mentions_wildcard) @@ -2051,7 +2051,7 @@ class MarkdownTest(ZulipTestCase): rendering_result = render_markdown(msg, content) self.assertEqual( rendering_result.rendered_content, - '' "@stream" " test
", + '@stream test
', ) self.assertTrue(rendering_result.mentions_wildcard) @@ -2105,7 +2105,7 @@ class MarkdownTest(ZulipTestCase): rendering_result = render_markdown(msg, content) self.assertEqual( rendering_result.rendered_content, - '' "@King Hamlet
", + f'@King Hamlet
', ) self.assertEqual(rendering_result.mentions_user_ids, {user_profile.id}) @@ -2113,7 +2113,7 @@ class MarkdownTest(ZulipTestCase): rendering_result = render_markdown(msg, content) self.assertEqual( rendering_result.rendered_content, - '' "@King Hamlet
", + f'@King Hamlet
', ) self.assertEqual(rendering_result.mentions_user_ids, {user_profile.id}) diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py index bae919f86c..82a030ec1c 100644 --- a/zerver/tests/test_message_edit.py +++ b/zerver/tests/test_message_edit.py @@ -712,11 +712,11 @@ class EditMessageTest(EditMessageTestCase): # Check content of message after edit. self.assertEqual( message_history_1[0]["rendered_content"], - "Here is a link to " 'zulip.
', + 'Here is a link to zulip.
', ) self.assertEqual( message_history_1[1]["rendered_content"], - "Here is a link to " 'zulip.
', + 'Here is a link to zulip.
', ) self.assertEqual( message_history_1[1]["content_html_diff"], diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index fab9bc5c06..80c9450190 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -995,7 +995,7 @@ class HandlePushNotificationTest(PushNotificationTest): ) for _, _, token in gcm_devices: self.assertIn( - "INFO:zerver.lib.push_notifications:" f"GCM: Sent {token} as {message.id}", + f"INFO:zerver.lib.push_notifications:GCM: Sent {token} as {message.id}", pn_logger.output, ) diff --git a/zerver/webhooks/taiga/view.py b/zerver/webhooks/taiga/view.py index 1587d5789c..6977059503 100644 --- a/zerver/webhooks/taiga/view.py +++ b/zerver/webhooks/taiga/view.py @@ -90,7 +90,7 @@ templates = { "delete": "[{user}]({user_link}) deleted user story {subject}.", "due_date": "[{user}]({user_link}) changed due date of user story {subject}" " from {old} to {new}.", - "set_due_date": "[{user}]({user_link}) set due date of user story {subject}" " to {new}.", + "set_due_date": "[{user}]({user_link}) set due date of user story {subject} to {new}.", }, "milestone": { "create": "[{user}]({user_link}) created sprint {subject}.", @@ -121,9 +121,8 @@ templates = { "commented": "[{user}]({user_link}) commented on task {subject}.", "delete": "[{user}]({user_link}) deleted task {subject}.", "changed_us": "[{user}]({user_link}) moved task {subject} from user story {old} to {new}.", - "due_date": "[{user}]({user_link}) changed due date of task {subject}" - " from {old} to {new}.", - "set_due_date": "[{user}]({user_link}) set due date of task {subject}" " to {new}.", + "due_date": "[{user}]({user_link}) changed due date of task {subject} from {old} to {new}.", + "set_due_date": "[{user}]({user_link}) set due date of task {subject} to {new}.", }, "issue": { "create": "[{user}]({user_link}) created issue {subject}.", @@ -146,7 +145,7 @@ templates = { "delete": "[{user}]({user_link}) deleted issue {subject}.", "due_date": "[{user}]({user_link}) changed due date of issue {subject}" " from {old} to {new}.", - "set_due_date": "[{user}]({user_link}) set due date of issue {subject}" " to {new}.", + "set_due_date": "[{user}]({user_link}) set due date of issue {subject} to {new}.", "blocked": "[{user}]({user_link}) blocked issue {subject}.", "unblocked": "[{user}]({user_link}) unblocked issue {subject}.", },