Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: cleanup-test_lib_pypy
Changeset: r95373:df2db0bd9619
Date: 2018-11-28 03:16 +0000
http://bitbucket.org/pypy/pypy/changeset/df2db0bd9619/

Log:    Merge test_exception_extra.py into test_exc.py

diff --git a/pypy/module/exceptions/test/test_exc.py 
b/pypy/module/exceptions/test/test_exc.py
--- a/pypy/module/exceptions/test/test_exc.py
+++ b/pypy/module/exceptions/test/test_exc.py
@@ -4,6 +4,10 @@
 class AppTestExc(object):
     spaceconfig = dict(usemodules=('exceptions',))
 
+    def test_import(self):
+        import exceptions
+        assert exceptions.SyntaxError is SyntaxError
+
     def test_baseexc(self):
         from exceptions import BaseException
 
@@ -117,6 +121,8 @@
         assert ee.strerror == "x"
         assert ee.filename == "y"
         assert EnvironmentError(3, "x").filename is None
+        e = EnvironmentError(1, "hello", "world")
+        assert str(e) == "[Errno 1] hello: 'world'"
 
     def test_windows_error(self):
         try:
@@ -145,6 +151,7 @@
 
     def test_system_exit(self):
         from exceptions import SystemExit
+        assert issubclass(SystemExit, BaseException)
         assert SystemExit().code is None
         assert SystemExit("x").code == "x"
         assert SystemExit(1, 2).code == (1, 2)
diff --git a/pypy/module/test_lib_pypy/test_exception_extra.py 
b/pypy/module/test_lib_pypy/test_exception_extra.py
deleted file mode 100644
--- a/pypy/module/test_lib_pypy/test_exception_extra.py
+++ /dev/null
@@ -1,21 +0,0 @@
-def app_test_environmenterror_repr():
-    import exceptions as ex 
-    e = ex.EnvironmentError("hello")
-    assert str(e) == "hello"
-    e = ex.EnvironmentError(1, "hello")
-    assert str(e) == "[Errno 1] hello"
-    e = ex.EnvironmentError(1, "hello", "world")
-    assert str(e) == "[Errno 1] hello: 'world'"
-
-def app_test_import():
-    import exceptions
-    assert exceptions.SyntaxError is SyntaxError 
-
-def app_test_baseexception():
-    assert issubclass(Exception, BaseException)
-
-def app_test_systemexit():
-    assert issubclass(SystemExit, BaseException)
-
-def app_test_keyboardinterrupt():
-    assert issubclass(KeyboardInterrupt, BaseException)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to