diff options
author | Miroslav Šedivý <[email protected]> | 2022-11-20 20:14:25 +0100 |
---|---|---|
committer | Miroslav Šedivý <[email protected]> | 2022-11-20 20:14:25 +0100 |
commit | 762861f3447698c6954016cf003758693dcc8bcc (patch) | |
tree | a43554b51e631bc62aa622fb0cf422d372303caa /tests | |
parent | 98760f650bcaafedead3f0b6e2b0c594ab857338 (diff) | |
download | mastodon.py-762861f3447698c6954016cf003758693dcc8bcc.tar.gz |
refactor: use is for None
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_account.py | 2 | ||||
-rw-r--r-- | tests/test_bookmarks.py | 2 | ||||
-rw-r--r-- | tests/test_hooks.py | 2 | ||||
-rw-r--r-- | tests/test_media.py | 2 | ||||
-rw-r--r-- | tests/test_notifications.py | 2 |
5 files changed, 5 insertions, 5 deletions
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): | |||
252 | assert featured_tag_list[0].name == "coolfree" | 252 | assert featured_tag_list[0].name == "coolfree" |
253 | assert "url" in featured_tag_list[0] | 253 | assert "url" in featured_tag_list[0] |
254 | finally: | 254 | finally: |
255 | if not featured_tag is None: | 255 | if featured_tag is not None: |
256 | api.featured_tag_delete(featured_tag) | 256 | api.featured_tag_delete(featured_tag) |
257 | api.featured_tag_delete(featured_tag_2) | 257 | api.featured_tag_delete(featured_tag_2) |
258 | 258 | ||
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): | |||
21 | assert status_unbookmarked.bookmarked == False | 21 | assert status_unbookmarked.bookmarked == False |
22 | 22 | ||
23 | bookmarked_statuses_2 = api.bookmarks() | 23 | bookmarked_statuses_2 = api.bookmarks() |
24 | assert not bookmarked_statuses_2 is None | 24 | assert bookmarked_statuses_2 is not None |
25 | assert len(bookmarked_statuses_2) == len(bookmarked_statuses) - 1 | 25 | assert len(bookmarked_statuses_2) == len(bookmarked_statuses) - 1 |
26 | 26 | ||
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): | |||
32 | 32 | ||
33 | @pytest.mark.vcr() | 33 | @pytest.mark.vcr() |
34 | def test_attribute_access(status): | 34 | def test_attribute_access(status): |
35 | assert status.id != None | 35 | assert status.id is not None |
36 | with pytest.raises(AttributeError): | 36 | with pytest.raises(AttributeError): |
37 | status.id = 420 | 37 | status.id = 420 |
38 | \ No newline at end of file | 38 | \ 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): | |||
45 | time.sleep(10) | 45 | time.sleep(10) |
46 | media2 = api.media(media) | 46 | media2 = api.media(media) |
47 | assert media2.id == media.id | 47 | assert media2.id == media.id |
48 | assert not media2.url is None | 48 | assert media2.url is not None |
49 | 49 | ||
50 | status = api.status_post( | 50 | status = api.status_post( |
51 | 'LOL check this out', | 51 | '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): | |||
29 | api.verify_minimum_version("2.9.2", cached=False) | 29 | api.verify_minimum_version("2.9.2", cached=False) |
30 | api.notifications_dismiss(notifications[0]) | 30 | api.notifications_dismiss(notifications[0]) |
31 | finally: | 31 | finally: |
32 | if not status is None: | 32 | if status is not None: |
33 | api2.status_delete(status) | 33 | api2.status_delete(status) |
34 | 34 | ||
35 | @pytest.mark.vcr() | 35 | @pytest.mark.vcr() |