Skip to content

Commit f881613

Browse files
committed
Make ty happy
1 parent 154be56 commit f881613

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/calibre/ebooks/docx/writer/tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,15 @@ def test_html_docx_html_roundtrip(self):
160160
for label, count in (('Styled', 1), ('Adjacent', 2), ('Nested', 1), ('Internal', 1), ('Cell one', 1), ('Cell two', 1)):
161161
self.assertEqual(len(paragraphs[label].xpath('.//a')), count, label)
162162
a = paragraphs['Styled'].find('a')
163+
assert a is not None
163164
self.assertEqual(''.join(a.itertext()), 'oddities linktext & ampersands')
164165
self.assertEqual(a.get('href'), 'https://example.com')
165166
self.assertEqual(a.get('title'), 'Example')
166167
self.assertEqual(''.join(paragraphs['Styled'].itertext()), 'Styled: oddities linktext & ampersands outside.')
167-
href = paragraphs['Internal'].find('a').get('href')
168+
a = paragraphs['Internal'].find('a')
169+
assert a is not None
170+
href = a.get('href')
171+
assert href is not None
168172
self.assertTrue(href.startswith('#'))
169173
self.assertTrue(result.xpath('//*[@id=$target]', target=href[1:]))
170174

0 commit comments

Comments
 (0)