Author: Philip Jenvey <[email protected]>
Branch: stdlib-2.7.8
Changeset: r72964:b5022d1064b2
Date: 2014-08-22 12:23 -0700
http://bitbucket.org/pypy/pypy/changeset/b5022d1064b2/

Log:    this belongs in test_sysmodule (grafted from
        6d940f0447f1438b9fb337172d25a971e3910f27)

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
@@ -147,24 +147,6 @@
         assert SystemExit("x").code == "x"
         assert SystemExit(1, 2).code == (1, 2)
 
-    def test_sys_exit(self):
-        import sys
-
-        exc = raises(SystemExit, sys.exit)
-        assert exc.value.code is None
-
-        exc = raises(SystemExit, sys.exit, 0)
-        assert exc.value.code == 0
-
-        exc = raises(SystemExit, sys.exit, 1)
-        assert exc.value.code == 1
-
-        exc = raises(SystemExit, sys.exit, 2)
-        assert exc.value.code == 2
-
-        exc = raises(SystemExit, sys.exit, (1, 2, 3))
-        assert exc.value.code == (1, 2, 3)
-
     def test_str_unicode(self):
         e = ValueError('&#224;&#232;&#236;')
         assert str(e) == '&#224;&#232;&#236;'
diff --git a/pypy/module/sys/test/test_sysmodule.py 
b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -123,6 +123,21 @@
         assert isinstance(li.bits_per_digit, int)
         assert isinstance(li.sizeof_digit, int)
 
+    def test_sys_exit(self):
+        import sys
+        exc = raises(SystemExit, sys.exit)
+        assert exc.value.code is None
+
+        exc = raises(SystemExit, sys.exit, 0)
+        assert exc.value.code == 0
+
+        exc = raises(SystemExit, sys.exit, 1)
+        assert exc.value.code == 1
+
+        exc = raises(SystemExit, sys.exit, (1, 2, 3))
+        assert exc.value.code == (1, 2, 3)
+
+
 class AppTestSysModulePortedFromCPython:
 
     def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to