Skip to content

Commit 9a3f8d9

Browse files
committed
converted asserts of descriptions test to pytest
1 parent 01cd091 commit 9a3f8d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_description.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_view_name_uses_class_name(self):
6060
"""
6161
class MockView(APIView):
6262
pass
63-
self.assertEqual(MockView().get_view_name(), 'Mock')
63+
assert MockView().get_view_name() == 'Mock'
6464

6565
def test_view_description_uses_docstring(self):
6666
"""Ensure view descriptions are based on the docstring."""
@@ -80,7 +80,7 @@ class MockView(APIView):
8080
8181
# hash style header #"""
8282

83-
self.assertEqual(MockView().get_view_description(), DESCRIPTION)
83+
assert MockView().get_view_description() == DESCRIPTION
8484

8585
def test_view_description_can_be_empty(self):
8686
"""
@@ -89,7 +89,7 @@ def test_view_description_can_be_empty(self):
8989
"""
9090
class MockView(APIView):
9191
pass
92-
self.assertEqual(MockView().get_view_description(), '')
92+
assert MockView().get_view_description() == ''
9393

9494
def test_view_description_can_be_promise(self):
9595
"""
@@ -111,7 +111,7 @@ def __str__(self):
111111
class MockView(APIView):
112112
__doc__ = MockLazyStr("a gettext string")
113113

114-
self.assertEqual(MockView().get_view_description(), 'a gettext string')
114+
assert MockView().get_view_description() == 'a gettext string'
115115

116116
def test_markdown(self):
117117
"""
@@ -120,7 +120,7 @@ def test_markdown(self):
120120
if apply_markdown:
121121
gte_21_match = apply_markdown(DESCRIPTION) == MARKED_DOWN_gte_21
122122
lt_21_match = apply_markdown(DESCRIPTION) == MARKED_DOWN_lt_21
123-
self.assertTrue(gte_21_match or lt_21_match)
123+
assert gte_21_match or lt_21_match
124124

125125

126126
def test_dedent_tabs():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy