summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2023-03-16 09:25:39 +0100
committerStefan Behnel <stefan_ml@behnel.de>2023-03-16 10:03:22 +0100
commit429e9aa08e8936c2a2c6f8306db6cccf5cc131f7 (patch)
tree0e3f50be034f370ac76bf91546a5a321b0015e83
parent71d754d82aa75376bacf702350dc110efe3ff53e (diff)
downloadcython-429e9aa08e8936c2a2c6f8306db6cccf5cc131f7.tar.gz
Tree assertions: while stripping Cython code, also remove all style information from the HTML file before searching for C code patterns to shorten the file content.
-rw-r--r--Cython/TestUtils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Cython/TestUtils.py b/Cython/TestUtils.py
index 8abcb90ce..d3a34e741 100644
--- a/Cython/TestUtils.py
+++ b/Cython/TestUtils.py
@@ -179,9 +179,15 @@ _strip_c_comments = partial(re.compile(
_strip_cython_code_from_html = partial(re.compile(
re.sub(r'\s\s+', '', r'''
+ (?:
<pre class=["'][^"']*cython\s+line[^"']*["']\s*>
(?:[^<]|<(?!/pre))+
</pre>
+ )|(?:
+ <style[^>]*>
+ (?:[^<]|<(?!/style))+
+ </style>
+ )
''')
).sub, '')