mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
tolerate --disable-unicode...
This commit is contained in:
parent
7c6a4ad78f
commit
9c373061ad
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
|
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
from test_support import run_unittest
|
from test_support import run_unittest, have_unicode
|
||||||
|
|
||||||
class UnaryOpTestCase(unittest.TestCase):
|
class UnaryOpTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -44,7 +44,8 @@ class UnaryOpTestCase(unittest.TestCase):
|
||||||
def test_bad_types(self):
|
def test_bad_types(self):
|
||||||
for op in '+', '-', '~':
|
for op in '+', '-', '~':
|
||||||
self.assertRaises(TypeError, eval, op + "'a'")
|
self.assertRaises(TypeError, eval, op + "'a'")
|
||||||
self.assertRaises(TypeError, eval, op + "u'a'")
|
if have_unicode:
|
||||||
|
self.assertRaises(TypeError, eval, op + "u'a'")
|
||||||
|
|
||||||
self.assertRaises(TypeError, eval, "~2j")
|
self.assertRaises(TypeError, eval, "~2j")
|
||||||
self.assertRaises(TypeError, eval, "~2.0")
|
self.assertRaises(TypeError, eval, "~2.0")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue