diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2011-07-30 02:57:28 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2011-07-30 02:57:28 (GMT) |
commit | 193cd2fb262ed1896f630f03e179a850db8a1001 (patch) | |
tree | 84381f9d58b857a35701542e4387d07d54c9b1ab /Lib/test | |
parent | 3d23fd649309fe80fdd1dee04b668fefb50c1b97 (diff) | |
parent | 18d7d7a2176e169942d5764516eee6f952610884 (diff) | |
download | cpython-193cd2fb262ed1896f630f03e179a850db8a1001.zip cpython-193cd2fb262ed1896f630f03e179a850db8a1001.tar.gz cpython-193cd2fb262ed1896f630f03e179a850db8a1001.tar.bz2 |
merge heads.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_builtin.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index aa9b4e2..4e33c23 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1343,6 +1343,13 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(ValueError, x.translate, b"1", 1) self.assertRaises(TypeError, x.translate, b"1"*256, 1) + def test_construct_singletons(self): + for const in None, Ellipsis, NotImplemented: + tp = type(const) + self.assertIs(tp(), const) + self.assertRaises(TypeError, tp, 1, 2) + self.assertRaises(TypeError, tp, a=1, b=2) + class TestSorted(unittest.TestCase): def test_basic(self): |