Author: Ronan Lamy <[email protected]>
Branch: py3.6
Changeset: r97312:b70c9c1a4b02
Date: 2019-08-27 18:34 +0100
http://bitbucket.org/pypy/pypy/changeset/b70c9c1a4b02/
Log: fix old merge cruft
diff --git a/lib-python/3/test/support/__init__.py
b/lib-python/3/test/support/__init__.py
--- a/lib-python/3/test/support/__init__.py
+++ b/lib-python/3/test/support/__init__.py
@@ -2309,9 +2309,6 @@
requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
'types are immortal if COUNT_ALLOCS is defined')
-requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
- 'types are immortal if COUNT_ALLOCS is defined')
-
def args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
settings in sys.flags and sys.warnoptions."""
diff --git a/lib-python/3/test/test_telnetlib.py
b/lib-python/3/test/test_telnetlib.py
--- a/lib-python/3/test/test_telnetlib.py
+++ b/lib-python/3/test/test_telnetlib.py
@@ -398,5 +398,4 @@
if __name__ == '__main__':
- import unittest
unittest.main()
diff --git a/lib-python/3/test/test_typing.py b/lib-python/3/test/test_typing.py
--- a/lib-python/3/test/test_typing.py
+++ b/lib-python/3/test/test_typing.py
@@ -628,15 +628,6 @@
with self.assertRaises(TypeError):
class MyGeneric(List[T], Generic[S]): ...
- def test_generic_errors(self):
- T = TypeVar('T')
- with self.assertRaises(TypeError):
- Generic[T]()
- with self.assertRaises(TypeError):
- isinstance([], List[int])
- with self.assertRaises(TypeError):
- issubclass(list, List[int])
-
def test_init(self):
T = TypeVar('T')
S = TypeVar('S')
diff --git a/lib-python/3/test/test_zipfile.py
b/lib-python/3/test/test_zipfile.py
--- a/lib-python/3/test/test_zipfile.py
+++ b/lib-python/3/test/test_zipfile.py
@@ -2251,71 +2251,5 @@
with open(path, 'rb') as f:
self.assertEqual(f.read(), zf.read(zi))
-
-class CommandLineTest(unittest.TestCase):
-
- def zipfilecmd(self, *args, **kwargs):
- rc, out, err = script_helper.assert_python_ok('-m', 'zipfile', *args,
- **kwargs)
- return out.replace(os.linesep.encode(), b'\n')
-
- def zipfilecmd_failure(self, *args):
- return script_helper.assert_python_failure('-m', 'zipfile', *args)
-
- def test_test_command(self):
- zip_name = findfile('zipdir.zip')
- out = self.zipfilecmd('-t', zip_name)
- self.assertEqual(out.rstrip(), b'Done testing')
- zip_name = findfile('testtar.tar')
- rc, out, err = self.zipfilecmd_failure('-t', zip_name)
- self.assertEqual(out, b'')
-
- def test_list_command(self):
- zip_name = findfile('zipdir.zip')
- t = io.StringIO()
- with zipfile.ZipFile(zip_name, 'r') as tf:
- tf.printdir(t)
- expected = t.getvalue().encode('ascii', 'backslashreplace')
- out = self.zipfilecmd('-l', zip_name,
- PYTHONIOENCODING='ascii:backslashreplace')
- self.assertEqual(out, expected)
-
- @requires_zlib
- def test_create_command(self):
- self.addCleanup(unlink, TESTFN)
- with open(TESTFN, 'w') as f:
- f.write('test 1')
- os.mkdir(TESTFNDIR)
- self.addCleanup(rmtree, TESTFNDIR)
- with open(os.path.join(TESTFNDIR, 'file.txt'), 'w') as f:
- f.write('test 2')
- files = [TESTFN, TESTFNDIR]
- namelist = [TESTFN, TESTFNDIR + '/', TESTFNDIR + '/file.txt']
- try:
- out = self.zipfilecmd('-c', TESTFN2, *files)
- self.assertEqual(out, b'')
- with zipfile.ZipFile(TESTFN2) as zf:
- self.assertEqual(zf.namelist(), namelist)
- self.assertEqual(zf.read(namelist[0]), b'test 1')
- self.assertEqual(zf.read(namelist[2]), b'test 2')
- finally:
- unlink(TESTFN2)
-
- def test_extract_command(self):
- zip_name = findfile('zipdir.zip')
- with temp_dir() as extdir:
- out = self.zipfilecmd('-e', zip_name, extdir)
- self.assertEqual(out, b'')
- with zipfile.ZipFile(zip_name) as zf:
- for zi in zf.infolist():
- path = os.path.join(extdir,
- zi.filename.replace('/', os.sep))
- if zi.filename.endswith('/'):
- self.assertTrue(os.path.isdir(path))
- else:
- self.assertTrue(os.path.isfile(path))
- with open(path, 'rb') as f:
- self.assertEqual(f.read(), zf.read(zi))
-
if __name__ == "__main__":
unittest.main()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit