From 762861f3447698c6954016cf003758693dcc8bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Sun, 20 Nov 2022 20:14:25 +0100 Subject: refactor: use is for None --- tests/test_account.py | 2 +- tests/test_bookmarks.py | 2 +- tests/test_hooks.py | 2 +- tests/test_media.py | 2 +- tests/test_notifications.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/test_account.py b/tests/test_account.py index 6f3b9a5..be48646 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -252,7 +252,7 @@ def test_featured_tags(api): assert featured_tag_list[0].name == "coolfree" assert "url" in featured_tag_list[0] finally: - if not featured_tag is None: + if featured_tag is not None: api.featured_tag_delete(featured_tag) api.featured_tag_delete(featured_tag_2) diff --git a/tests/test_bookmarks.py b/tests/test_bookmarks.py index e5e0d7c..2e1261b 100644 --- a/tests/test_bookmarks.py +++ b/tests/test_bookmarks.py @@ -21,6 +21,6 @@ def test_bookmarks(api, status): assert status_unbookmarked.bookmarked == False bookmarked_statuses_2 = api.bookmarks() - assert not bookmarked_statuses_2 is None + assert bookmarked_statuses_2 is not None assert len(bookmarked_statuses_2) == len(bookmarked_statuses) - 1 diff --git a/tests/test_hooks.py b/tests/test_hooks.py index f0139e5..ab33d4c 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -32,7 +32,7 @@ def test_date_hook(status): @pytest.mark.vcr() def test_attribute_access(status): - assert status.id != None + assert status.id is not None with pytest.raises(AttributeError): status.id = 420 \ No newline at end of file diff --git a/tests/test_media.py b/tests/test_media.py index 7a358dd..9668f59 100644 --- a/tests/test_media.py +++ b/tests/test_media.py @@ -45,7 +45,7 @@ def test_media_post(api, sensitive): time.sleep(10) media2 = api.media(media) assert media2.id == media.id - assert not media2.url is None + assert media2.url is not None status = api.status_post( 'LOL check this out', diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 6e761ce..858bad4 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -29,7 +29,7 @@ def test_notifications_dismiss_pre_2_9_2(api, api2): api.verify_minimum_version("2.9.2", cached=False) api.notifications_dismiss(notifications[0]) finally: - if not status is None: + if status is not None: api2.status_delete(status) @pytest.mark.vcr() -- cgit v1.2.3