mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 11:49:53 +02:00
✔️ Explicitly check for None
Explicitly check for None to remove this warning: test/test_recognize.py::test_word_segmentation /home/mike/devel/ocrd_calamari/test/test_recognize.py:133: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. assert line
This commit is contained in:
parent
3a4013572c
commit
41a48455f8
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ def test_word_segmentation(workspace):
|
|||
|
||||
# The result should contain a TextLine that contains the text "December"
|
||||
line = tree.xpath(".//pc:TextLine[pc:TextEquiv/pc:Unicode[contains(text(),'December')]]", namespaces=NSMAP)[0]
|
||||
assert line
|
||||
assert line is not None
|
||||
|
||||
# The textline should a. contain multiple words and b. these should concatenate fine to produce the same line text
|
||||
words = line.xpath(".//pc:Word", namespaces=NSMAP)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue