Skip to content

Commit 5fd5c3a

Browse files
committed
minor fix for tests
1 parent 49e08fc commit 5fd5c3a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_autodocsumm.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ def test_class(self, app, status, warning):
119119
app.build()
120120
html = get_html(app, '/test_class.html')
121121

122-
if sphinx_version[:2] != [3, 1]:
122+
if sphinx_version[:2] > [3, 1]:
123+
self.assertIn(
124+
'<span class="pre">instance_attribute</span>',
125+
html)
126+
elif sphinx_version[:2] < [3, 1]:
123127
self.assertIn(
124128
'<span class="pre">dummy.TestClass.instance_attribute</span>',
125129
html)
@@ -162,7 +166,11 @@ def test_class_summary_only(self, app, status, warning):
162166
app.build()
163167
html = get_html(app, '/test_class_summary_only.html')
164168

165-
if sphinx_version[:2] != [3, 1]:
169+
if sphinx_version[:2] > [3, 1]:
170+
self.assertIn(
171+
'<span class="pre">instance_attribute</span>',
172+
html)
173+
elif sphinx_version[:2] < [3, 1]:
166174
self.assertIn(
167175
'<span class="pre">dummy.TestClass.instance_attribute</span>',
168176
html)

0 commit comments

Comments
 (0)