diff options
| author | Ezio Melotti <none@none> | 2011-04-13 03:58:29 (GMT) |
|---|---|---|
| committer | Ezio Melotti <none@none> | 2011-04-13 03:58:29 (GMT) |
| commit | 4f95a52fe24cd136da5634747d5334c86d400d2d (patch) | |
| tree | 6e36106a1dc10b0e3ea2f85918185843660aec57 /Lib/json/tests/test_scanstring.py | |
| parent | a8b0f9adfeac1aa5bb8189c46a9cc7d01f89d8a5 (diff) | |
| download | cpython-4f95a52fe24cd136da5634747d5334c86d400d2d.zip cpython-4f95a52fe24cd136da5634747d5334c86d400d2d.tar.gz cpython-4f95a52fe24cd136da5634747d5334c86d400d2d.tar.bz2 | |
#9233: skip _json-specific tests when _json is not available.
Diffstat (limited to 'Lib/json/tests/test_scanstring.py')
| -rw-r--r-- | Lib/json/tests/test_scanstring.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/json/tests/test_scanstring.py b/Lib/json/tests/test_scanstring.py index d503851..8f5999e 100644 --- a/Lib/json/tests/test_scanstring.py +++ b/Lib/json/tests/test_scanstring.py @@ -1,14 +1,20 @@ import sys import decimal -from unittest import TestCase +from unittest import TestCase, skipUnless import json import json.decoder +try: + import _json +except ImportError: + _json = None + class TestScanString(TestCase): def test_py_scanstring(self): self._test_scanstring(json.decoder.py_scanstring) + @skipUnless(_json, 'test requires the _json module') def test_c_scanstring(self): if json.decoder.c_scanstring is not None: self._test_scanstring(json.decoder.c_scanstring) |
