From 90d233381885e9718c62fec56d93e26c751964ea Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 13 Mar 2023 22:31:36 +0000 Subject: [PATCH] python: update for latest ruff 0.0.255 --- python/pyproject.toml | 2 +- python/tests/test_1_online.py | 6 +++--- python/tests/test_3_offline.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index fb846cc8f..1cd94c48e 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -51,7 +51,7 @@ git_describe_command = "git describe --dirty --tags --long --match v*.*" line-length = 120 [tool.ruff] -select = ["E", "F", "W", "YTT", "C4", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP004", "UP010", "UP031", "UP032", "ANN204"] +select = ["E", "F", "W", "YTT", "C40", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP004", "UP010", "UP031", "UP032", "ANN204"] line-length = 120 [tool.isort] diff --git a/python/tests/test_1_online.py b/python/tests/test_1_online.py index d1761f02e..412247cbb 100644 --- a/python/tests/test_1_online.py +++ b/python/tests/test_1_online.py @@ -217,13 +217,13 @@ def test_html_message(acfactory, lp): lp.sec("ac1: prepare and send text message to ac2") msg1 = chat.send_text("message0") assert not msg1.has_html() - assert msg1.html == "" + assert not msg1.html lp.sec("wait for ac2 to receive message") msg2 = ac2._evtracker.wait_next_incoming_message() assert msg2.text == "message0" assert not msg2.has_html() - assert msg2.html == "" + assert not msg2.html lp.sec("ac1: prepare and send HTML+text message to ac2") msg1 = Message.new_empty(ac1, "text") @@ -2150,7 +2150,7 @@ def test_status(acfactory): chat12.send_text("hello") msg = ac2._evtracker.wait_next_incoming_message() assert msg.text == "hello" - assert msg.get_sender_contact().status == "" + assert not msg.get_sender_contact().status def test_group_quote(acfactory, lp): diff --git a/python/tests/test_3_offline.py b/python/tests/test_3_offline.py index e7a1a6231..e9a297681 100644 --- a/python/tests/test_3_offline.py +++ b/python/tests/test_3_offline.py @@ -295,8 +295,8 @@ class TestOfflineChat: assert d["archived"] == chat.is_archived() # assert d["param"] == chat.param assert d["color"] == chat.get_color() - assert d["profile_image"] == "" if chat.get_profile_image() is None else chat.get_profile_image() - assert d["draft"] == "" if chat.get_draft() is None else chat.get_draft() + assert not d["profile_image"] if chat.get_profile_image() is None else chat.get_profile_image() + assert not d["draft"] if chat.get_draft() is None else chat.get_draft() def test_group_chat_creation_with_translation(self, ac1): ac1.set_stock_translation(const.DC_STR_GROUP_NAME_CHANGED_BY_YOU, "abc %1$s xyz %2$s")