##// END OF EJS Templates
Add cpython2_only decorator...
Danilo J. S. Bellini -
Show More
@@ -12,7 +12,8 b' import types, string, ctypes'
12 import nose.tools as nt
12 import nose.tools as nt
13
13
14 from IPython.lib import pretty
14 from IPython.lib import pretty
15 from IPython.testing.decorators import skip_without, py2_only, py3_only
15 from IPython.testing.decorators import (skip_without, py2_only, py3_only,
16 cpython2_only)
16 from IPython.utils.py3compat import PY3, unicode_to_str
17 from IPython.utils.py3compat import PY3, unicode_to_str
17
18
18 if PY3:
19 if PY3:
@@ -483,7 +484,7 b' def test_mappingproxy():'
483 for obj, expected in cases:
484 for obj, expected in cases:
484 nt.assert_equal(pretty.pretty(obj), expected)
485 nt.assert_equal(pretty.pretty(obj), expected)
485
486
486 @py2_only
487 @cpython2_only # In PyPy, types.DictProxyType is dict
487 def test_dictproxy():
488 def test_dictproxy():
488 # This is the dictproxy constructor itself from the Python API,
489 # This is the dictproxy constructor itself from the Python API,
489 DP = ctypes.pythonapi.PyDictProxy_New
490 DP = ctypes.pythonapi.PyDictProxy_New
@@ -48,7 +48,7 b' from .ipunittest import ipdoctest, ipdocstring'
48 from IPython.external.decorators import *
48 from IPython.external.decorators import *
49
49
50 # For onlyif_cmd_exists decorator
50 # For onlyif_cmd_exists decorator
51 from IPython.utils.py3compat import string_types, which, PY2, PY3
51 from IPython.utils.py3compat import string_types, which, PY2, PY3, PYPY
52
52
53 #-----------------------------------------------------------------------------
53 #-----------------------------------------------------------------------------
54 # Classes and functions
54 # Classes and functions
@@ -336,6 +336,7 b" skip_known_failure = knownfailureif(True,'This test is known to fail')"
336 known_failure_py3 = knownfailureif(sys.version_info[0] >= 3,
336 known_failure_py3 = knownfailureif(sys.version_info[0] >= 3,
337 'This test is known to fail on Python 3.')
337 'This test is known to fail on Python 3.')
338
338
339 cpython2_only = skipif(PY3 or PYPY, "This test only runs on CPython 2.")
339 py2_only = skipif(PY3, "This test only runs on Python 2.")
340 py2_only = skipif(PY3, "This test only runs on Python 2.")
340 py3_only = skipif(PY2, "This test only runs on Python 3.")
341 py3_only = skipif(PY2, "This test only runs on Python 3.")
341
342
@@ -292,6 +292,7 b' else:'
292
292
293
293
294 PY2 = not PY3
294 PY2 = not PY3
295 PYPY = any(k.startswith("pypy") for k in dir(sys))
295
296
296
297
297 def annotate(**kwargs):
298 def annotate(**kwargs):
General Comments 0
You need to be logged in to leave comments. Login now