diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-13 04:18:24 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-13 04:18:24 (GMT) |
| commit | 04c6423fbab6f4a525d56cedc91600a52d74f062 (patch) | |
| tree | f6f0099cd34a142ddbc5f53569d46dadedc34cab /Lib/test/json_tests/test_speedups.py | |
| parent | 1a20c121ef3cfc53cf8ec754cbba8ef82933f175 (diff) | |
| parent | d210aa1ad9329661625ca5f0b6754f84ffc25021 (diff) | |
| download | cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.zip cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.tar.gz cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.tar.bz2 | |
Merge with 3.1.
Diffstat (limited to 'Lib/test/json_tests/test_speedups.py')
| -rw-r--r-- | Lib/test/json_tests/test_speedups.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/test/json_tests/test_speedups.py b/Lib/test/json_tests/test_speedups.py index 2718409..b7c141f 100644 --- a/Lib/test/json_tests/test_speedups.py +++ b/Lib/test/json_tests/test_speedups.py @@ -1,16 +1,22 @@ -from unittest import TestCase +from unittest import TestCase, skipUnless from json import decoder, encoder, scanner +try: + import _json +except ImportError: + _json = None + +@skipUnless(_json, 'test requires the _json module') class TestSpeedups(TestCase): def test_scanstring(self): self.assertEqual(decoder.scanstring.__module__, "_json") - self.assertTrue(decoder.scanstring is decoder.c_scanstring) + self.assertIs(decoder.scanstring, decoder.c_scanstring) def test_encode_basestring_ascii(self): self.assertEqual(encoder.encode_basestring_ascii.__module__, "_json") - self.assertTrue(encoder.encode_basestring_ascii is - encoder.c_encode_basestring_ascii) + self.assertIs(encoder.encode_basestring_ascii, + encoder.c_encode_basestring_ascii) class TestDecode(TestCase): def test_make_scanner(self): |
