Mark version 3.13.0 (#5495)

* bump to 3.13.1
* fix some tests
* strip left whitespace from doc
* remove specific difflib test that was causing issues
* fix test_enum

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
Ashwin Naren
2025-02-12 21:11:01 -08:00
committed by GitHub
parent 6e35e20e49
commit a46ce8ec3a
20 changed files with 407 additions and 308 deletions

View File

@@ -7,9 +7,7 @@ myobj = MyObject()
assert myobj == myobj
assert not myobj != myobj
object.__subclasshook__() == NotImplemented
object.__subclasshook__(1) == NotImplemented
object.__subclasshook__(1, 2) == NotImplemented
assert MyObject().__eq__(MyObject()) == NotImplemented
assert MyObject().__ne__(MyObject()) == NotImplemented

View File

@@ -1,27 +0,0 @@
# unittest for modified imghdr.py
# Should be replace it into https://github.com/python/cpython/blob/main/Lib/test/test_imghdr.py
import os
import imghdr
TEST_FILES = (
#('python.png', 'png'),
('python.gif', 'gif'),
('python.bmp', 'bmp'),
('python.ppm', 'ppm'),
('python.pgm', 'pgm'),
('python.pbm', 'pbm'),
('python.jpg', 'jpeg'),
('python.ras', 'rast'),
#('python.sgi', 'rgb'),
('python.tiff', 'tiff'),
('python.xbm', 'xbm'),
('python.webp', 'webp'),
('python.exr', 'exr'),
)
resource_dir = os.path.join(os.path.dirname(__file__), 'imghdrdata')
for fname, expected in TEST_FILES:
res = imghdr.what(os.path.join(resource_dir, fname))
assert res == expected

View File

@@ -32,7 +32,7 @@ p = subprocess.Popen(sleep(2))
assert p.poll() is None
with assert_raises(subprocess.TimeoutExpired):
assert p.wait(1)
assert p.wait(1)
p.wait()
@@ -48,17 +48,17 @@ p = subprocess.Popen(sleep(2))
p.terminate()
p.wait()
if is_unix:
assert p.returncode == -signal.SIGTERM
assert p.returncode == -signal.SIGTERM
else:
assert p.returncode == 1
assert p.returncode == 1
p = subprocess.Popen(sleep(2))
p.kill()
p.wait()
if is_unix:
assert p.returncode == -signal.SIGKILL
assert p.returncode == -signal.SIGKILL
else:
assert p.returncode == 1
assert p.returncode == 1
p = subprocess.Popen(echo("test"), stdout=subprocess.PIPE)
(stdout, stderr) = p.communicate()
@@ -66,4 +66,4 @@ assert stdout.strip() == b"test"
p = subprocess.Popen(sleep(5), stdout=subprocess.PIPE)
with assert_raises(subprocess.TimeoutExpired):
p.communicate(timeout=1)
p.communicate(timeout=1)

View File

@@ -1,12 +0,0 @@
# This probably will be superceeded by the python unittests when that works.
import xdrlib
p = xdrlib.Packer()
p.pack_int(1337)
d = p.get_buffer()
print(d)
# assert d == b'\x00\x00\x059'

View File

@@ -50,7 +50,7 @@ class Bar:
assert x == 3
assert Bar.__doc__ == " W00t "
assert Bar.__doc__ == "W00t "
bar = Bar(42)
assert bar.get_x.__doc__ == None
@@ -147,7 +147,7 @@ class T3:
test3
"""
assert T3.__doc__ == "\n test3\n "
assert T3.__doc__ == "\ntest3\n"
class T4:

View File

@@ -0,0 +1,15 @@
def f1():
"""
x
\ty
"""
assert f1.__doc__ == '\nx\ny\n'
def f2():
"""
\t x
\t\ty
"""
assert f2.__doc__ == '\nx\n y\n'

View File

@@ -44,7 +44,7 @@ def f3():
"""
pass
assert f3.__doc__ == "\n test3\n "
assert f3.__doc__ == "\ntest3\n"
def f4():
"test4"