forked from Rust-related/RustPython
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
@@ -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:
|
||||
|
||||
|
||||
15
extra_tests/snippets/syntax_doc.py
Normal file
15
extra_tests/snippets/syntax_doc.py
Normal 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'
|
||||
@@ -44,7 +44,7 @@ def f3():
|
||||
"""
|
||||
pass
|
||||
|
||||
assert f3.__doc__ == "\n test3\n "
|
||||
assert f3.__doc__ == "\ntest3\n"
|
||||
|
||||
def f4():
|
||||
"test4"
|
||||
|
||||
Reference in New Issue
Block a user