summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2025-09-01 23:52:43 +0200
committerjvoisin2025-09-01 23:52:43 +0200
commit7a8ea224bc327b8ee929379d577c74968ea1c352 (patch)
tree9bac24550395b843de29c901aa361031a1a1fb15
parent504efb24488c870a71afb434644fce972817b412 (diff)
Fix issue introduced in f073444
The continuous integration on 0xacab didn't run, so it didn't catch this issue. It seems like we'll have to move to github or whatever instead, sigh.
-rw-r--r--tests/test_libmat2.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
index 19e47aa..571f92d 100644
--- a/tests/test_libmat2.py
+++ b/tests/test_libmat2.py
@@ -4,6 +4,7 @@ import unittest
4import shutil 4import shutil
5import os 5import os
6import re 6import re
7import sys
7import tarfile 8import tarfile
8import tempfile 9import tempfile
9import zipfile 10import zipfile
@@ -638,10 +639,20 @@ class TestCleaning(unittest.TestCase):
638 os.remove('./tests/data/clean.cleaned.html') 639 os.remove('./tests/data/clean.cleaned.html')
639 os.remove('./tests/data/clean.cleaned.cleaned.html') 640 os.remove('./tests/data/clean.cleaned.cleaned.html')
640 641
641 with open('./tests/data/clean.html', 'w') as f: 642 if sys.version_info >= (3, 13):
642 f.write('<title><title><pouet/><meta/></title></title><test/>') 643 with open('./tests/data/clean.html', 'w') as f:
643 with self.assertRaises(ValueError): 644 f.write('<title><title><pouet/><meta/></title></title><test/>')
645 with self.assertRaises(ValueError):
646 p = web.HTMLParser('./tests/data/clean.html')
647 else:
648 with open('./tests/data/clean.html', 'w') as f:
649 f.write('<title><title><pouet/><meta/></title></title><test/>')
644 p = web.HTMLParser('./tests/data/clean.html') 650 p = web.HTMLParser('./tests/data/clean.html')
651 self.assertTrue(p.remove_all())
652 with open('./tests/data/clean.cleaned.html', 'r') as f:
653 self.assertEqual(f.read(), '<title></title><test/>')
654 os.remove('./tests/data/clean.cleaned.html')
655 os.remove('./tests/data/clean.html')
645 656
646 with open('./tests/data/clean.html', 'w') as f: 657 with open('./tests/data/clean.html', 'w') as f:
647 f.write('<test><title>Some<b>metadata</b><br/></title></test>') 658 f.write('<test><title>Some<b>metadata</b><br/></title></test>')