forked from pool/python311
- Security
- gh-139700: Check consistency of the zip64 end of central
directory record. Support records with “zip64 extensible data”
if there are no bytes prepended to the ZIP file.
- gh-139400: xml.parsers.expat: Make sure that parent Expat
parsers are only garbage-collected once they are no longer
referenced by subparsers created by
ExternalEntityParserCreate(). Patch by Sebastian Pipping.
- gh-135661: Fix parsing start and end tags in
html.parser.HTMLParser according to the HTML5 standard.
* Whitespaces no longer accepted between </ and the tag name. E.g.
</ script> does not end the script section.
* Vertical tabulation (\v) and non-ASCII whitespaces no longer
recognized as whitespaces. The only whitespaces are \t\n\r\f and
space.
* Null character (U+0000) no longer ends the tag name.
* Attributes and slashes after the tag name in end tags are now
ignored, instead of terminating after the first > in quoted
attribute value. E.g. </script/foo=">"/>.
* Multiple slashes and whitespaces between the last attribute and
closing > are now ignored in both start and end tags. E.g. <a
foo=bar/ //>.
* Multiple = between attribute name and value are no longer
collapsed. E.g. <a foo==bar> produces attribute “foo” with value
“=bar”.
- gh-135661: Fix CDATA section parsing in html.parser.HTMLParser
according to the HTML5 standard: ] ]> and ]] > no longer end the
CDATA section. Add private method _set_support_cdata() which can
be used to specify how to parse <[CDATA[ — as a CDATA section in
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python311?expand=0&rev=199
70 lines
1.8 KiB
Python
70 lines
1.8 KiB
Python
#!/usr/bin/python3
|
|
"""
|
|
Simple regexp-based skipped test checker.
|
|
It lists tests that are mentioned (presumably for exclusion)
|
|
in BASE, and in MAIN (presumably for inclusion)
|
|
and reports discrepancies.
|
|
|
|
This will have a number of
|
|
"""
|
|
|
|
MAIN = "python39.spec"
|
|
|
|
import glob
|
|
import re
|
|
from os.path import basename
|
|
|
|
alltests = set()
|
|
qemu_exclusions = set()
|
|
|
|
for item in glob.glob("Python-*/Lib/test/test_*"):
|
|
testname = basename(item)
|
|
if testname.endswith(".py"):
|
|
testname = testname[:-3]
|
|
alltests.add(testname)
|
|
|
|
testre = re.compile(r'[\s"](test_\w+)\b')
|
|
|
|
def find_tests_in_spec(specname):
|
|
global qemu_exclusions
|
|
|
|
found_tests = set()
|
|
with open(specname) as spec:
|
|
in_qemu = False
|
|
for line in spec:
|
|
line = line.strip()
|
|
if "#" in line:
|
|
line = line[:line.index("#")]
|
|
tests = set(testre.findall(line))
|
|
found_tests |= tests
|
|
if line == "%if 0%{?qemu_user_space_build} > 0":
|
|
in_qemu = True
|
|
if in_qemu:
|
|
if line == "%endif":
|
|
in_qemu = False
|
|
qemu_exclusions |= tests
|
|
return found_tests
|
|
|
|
excluded = find_tests_in_spec(MAIN)
|
|
|
|
#print("--- excluded tests:", " ".join(sorted(excluded)))
|
|
#print("--- included tests:", " ".join(sorted(included)))
|
|
|
|
mentioned = excluded
|
|
nonexistent = mentioned - alltests
|
|
missing = excluded - qemu_exclusions
|
|
|
|
print("--- the following tests are excluded for QEMU and not tested in python")
|
|
print("--- (that probably means we don't need to worry about them)")
|
|
for test in sorted(qemu_exclusions - excluded):
|
|
print(test)
|
|
|
|
print("--- the following tests might be excluded in python:")
|
|
for test in sorted(missing):
|
|
print(test)
|
|
|
|
if nonexistent:
|
|
print("--- the following tests don't exist:")
|
|
for test in sorted(nonexistent):
|
|
print(test)
|