[pypy-commit] pypy py3.3: this belongs in test_sysmodule
pjenvey
noreply at buildbot.pypy.org
Sat Aug 23 00:05:13 CEST 2014
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r72962:6d940f0447f1
Date: 2014-08-22 12:23 -0700
http://bitbucket.org/pypy/pypy/changeset/6d940f0447f1/
Log: this belongs in test_sysmodule
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
@@ -127,24 +127,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('àèì')
assert str(e) == 'àèì'
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
@@ -169,6 +169,20 @@
assert isinstance(li.nan, int)
assert isinstance(li.imag, 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):
More information about the pypy-commit
mailing list